PHP-FFMpeg/PHP-FFMpeg — pull request #128 by curtisdf (2014-09-21 04:19:07+00:00)
Title: More flexibility in encoding options

I split up the save() method in FFMpeg\Media\Video.php to allow bypassing the FFMpeg\Format\* classes and inputting an arbitrary array of encoding options. I did it in such a way that it doesn't break any existing functionality or the unit tests. So now, in addition to using save() the same as before, the following can also be used instead:

$video->transcode($outputPathfile, $encodingOptions, $totalPasses, $progressableInterfaceOrCallback);

where $encodingOptions is a simple indexed array of FFMpeg options like what save() uses internally.

This allows for a much broader range of encoding situations, since the FFMpeg\Format\* classes enforce the "-b:v XXX" setting which is not always desirable (e.g. when doing Variable Bit Rate or Average Bit Rate encoding), and since the existing save() method hard-codes a long list of libx264 encoding options. (I would have removed this list, but I wanted to keep my changes 100% backward-compatible in order to avoid breaking anyone's existing setup.)

I also added a couple filenames to the main .gitignore which probably should not be versioned.

Thanks!
-Curtis