Run ffmpeg without outputting configuration information?
Solution 1
This is now possible as of FFmpeg 2.2 with the -hide_banner
option. See also the relevant commit and ticket.
Solution 2
AFAIK there is no way, loglevel
is no use. Look at ffmpeg.c:
init_opts();
show_banner();
and cmdutils.c:
void show_banner(void)
{
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n",
program_name, program_birth_year, this_year);
fprintf(stderr, " built on %s %s with %s %s\n",
__DATE__, __TIME__, CC_TYPE, CC_VERSION);
fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n");
print_all_libs_info(stderr, INDENT|SHOW_CONFIG);
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
}
See here for an unsuccessful attempt of skipping it (I don't get what the GPL has to do with anything of this). I suggest you to file a bug and hope you are convicing enough.
As many others, I have ffmpeg compiled with show_banner()
commented out, it's simply tiresome.
Solution 3
Take a look at ffmpeg's manpage, especially the -loglevel
parameter.
Matt Joiner
About Me I like parsimonious code, with simple interfaces and excellent documentation. I'm not interested in enterprise, boiler-plate, or cookie-cutter nonsense. I oppose cruft and obfuscation. My favourite languages are Go, Python and C. I wish I was better at Haskell. Google+ GitHub Bitbucket Google code My favourite posts http://stackoverflow.com/questions/3609469/what-are-the-thread-limitations-when-working-on-linux-compared-to-processes-for/3705919#3705919 http://stackoverflow.com/questions/4352425/what-should-i-learn-first-before-heading-to-c/4352469#4352469 http://stackoverflow.com/questions/6167809/how-much-bad-can-be-done-using-register-variables-in-c/6168852#6168852 http://stackoverflow.com/questions/4141307/c-and-c-source-code-profiling-tools/4141345#4141345 http://stackoverflow.com/questions/3463207/how-big-can-a-malloc-be-in-c/3486163#3486163 http://stackoverflow.com/questions/4095637/memory-use-of-stl-data-structures-windows-vs-linux/4183178#4183178
Updated on June 14, 2022Comments
-
Matt Joiner about 2 years
I'm invoking
ffmpeg
withsubprocess.Popen
, and trying to capture thestderr
output and write it tologging
.args = ['ffmpeg', '-i', path] if start: args += ['-ss', start] if end: args += ['-t', end] args += [ '-vcodec', 'copy', '-acodec', 'copy', '-scodec', 'copy', '-f', 'mpegts', '-y', '/dev/stdout'] self.child = subprocess.Popen( args, stdin=open(os.devnull, 'rb'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
ffmpeg
generates a lot of configuration information like the following:FFmpeg version 0.6.2-4:0.6.2-1ubuntu1, Copyright (c) 2000-2010 the Libav developers built on Mar 22 2011 15:55:04 with gcc 4.5.2
configuration: --extra-version=4:0.6.2-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static WARNING: library configuration mismatch libavutil configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static libavcodec configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0Prior to finally outputting the stuff I'd like to log:
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (66893/1395) -> 23.98 (66893/2790) At least one output file must be specified
Is there an option to prevent this excessive output? Should I be doing it differently?