Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial parameters #703

Merged
merged 1 commit into from Mar 23, 2020
Merged

Added initial parameters #703

merged 1 commit into from Mar 23, 2020

Conversation

iljalukin
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #625, #675
License MIT

What's in this PR?

This is a similar method to setAdditionalParamaters. It allows you to instead set an array of 'initial' parameters that are added before the input file. I needed this mainly because I'm recording realtime video in OPUS and transcoding the audio for playback to AAC. An ffmpeg build with libopus requires you to pass '-acodec libopus' otherwise it defaults to the default opus codec which doesn't work very well.

It's fairly common when using the newer proprietary codecs to require this ability.

Why?

This fixes not being able to pass initial parameters before the input file is added to the build command. #625, #675

Example Usage

$format = new FFMpeg\Format\Video\X264();
$format->setInitialParameters(array('-acodec', 'libopus'));
$video->save($format, 'video.avi');

Attribution goes to @throttlehead, I've just added the unit test

@iljalukin iljalukin mentioned this pull request Feb 25, 2020
Copy link
Member

@jens1o jens1o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good to me, however this is a breaking change due to the change in the VideoInterface

@jens1o
Copy link
Member

jens1o commented Mar 2, 2020

@alexander-schranz your thoughts on this?

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Mar 4, 2020

@jens1o PR looks good for me. As you marked correctly we need to release this in 0.15 or in 1.0 as we added something to the Interface.

@jens1o jens1o merged commit 984dbd0 into PHP-FFMpeg:master Mar 23, 2020
@jens1o
Copy link
Member

jens1o commented Mar 23, 2020

sorry for the long wait, releasing now..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants