[FFmpeg-user] External encoder support?
Darkmoon
darkmoon at verizon.net
Fri May 23 04:53:12 CEST 2014
FFmpeg does nearly everything now except, so far as I can tell, support
external, stand-alone encoders (that is to say, call external encoders
from within ffmpeg, and then process and mux the results). Can I
possibly interest one of the developers in adding this feature?
Unfortunately, some encoders are available only as already built
executables, and perhaps a few others are not written with a library
component that can be supported in an application like ffmpeg. Or, a
user may want access to features that are not supported in the ffmpeg
wrapper for a particular encoder, and must use the stand-alone version
to get them.
Fortunately, though, most stand-alone encoders will accept input on
stdin, and will output to stdout--this (hopefully) makes it a
relatively simple matter to spawn()/fork() an external encoder and then
attach pipes to it. What may be a little more involved is adding a way
to tell ffmpeg what format the external encoder's input needs to be,
but I suspect even this would not be too involved for someone already
familiar with the ffmpeg codebase (which I am not :)).
As an example (and also why I am asking for this feature), I use Nero's
reference AAC encoder because 1) it is better than libfdk_aac, and 2) I
use Zeranoe builds for Windows and, even though I have Cygwin/32-bit
MinGW, I'm not quite ready yet to build all the libraries I would want
in my own ffmpeg build. (I should point out that the Nero AAC package
includes Linux binaries as well as Win32 ones.)
Currently, I use Nero AAC with ffmpeg in this way:
$ ffmpeg -i INPUT -map 0:v -c:v libx264 OUTPUT.m4v -map 0:a -af \
"aresample=async=1" -f wav - | neroaacenc -q QSCALE_FACTOR \
-ignorelength -if - -of OUTPUT.m4a
(...with various additional options and filter chains as needed...)
$ ffmpeg -i OUTPUT.m4v -i OUTPUT.m4a -c copy FINAL_OUTPUT.mp4
Using 'async' in this way usually maintains A/V sync...but not always.
And, if I also wanted to call an external video encoder, I am out of
luck. Anyway, it would be lovely not to have to call ffmpeg a second
time to mux the results from the first run. Thanks for listening,
Jeff
More information about the ffmpeg-user
mailing list