ffmpeg -f lavfi with -i color / r flag behaves strangely
Hi. Why does the the "r" flag behave differently in the two cases below? The output for test2.avi shows 25 fps instead of the desired 50 fps. Only the tbn flag is 50. ffprobe, however, shows a value of 50 for all timestamps for both avi files. cheers! ffmpeg -f lavfi -i color=d=10:r=50 -c copy test1.avi ffmpeg version N-80117-gdac030d Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 43.100 / 57. 43.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, lavfi, from 'color=d=10:r=50': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 50 fps, 50 tbr, 50 tbn [avi @ 00000000001dd8c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Output #0, avi, to 'test1.avi': Metadata: ISFT : Lavf57.37.101 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 50 fps, 50 tbr, 50 tbn Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 500 fps=0.0 q=-1.0 Lsize= 56267kB time=00:00:10.00 bitrate=46094.2kbits/s speed= 108x video:56250kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.030837% ffmpeg -f lavfi -i color=d=10 -r 50 -c copy test2.avi ffmpeg version N-80117-gdac030d Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 43.100 / 57. 43.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, lavfi, from 'color=d=10': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn [avi @ 00000000006508e0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Output #0, avi, to 'test2.avi': Metadata: ISFT : Lavf57.37.101 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 25 tbr, 50 tbn Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 250 fps=0.0 q=-1.0 Lsize= 28142kB time=00:00:09.98 bitrate=23100.4kbits/s speed= 216x video:28125kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.061674%
gf <fortyman <at> gmx.de> writes:
ffmpeg -f lavfi -i color=d=10 -r 50 -c copy test2.avi
How is this supposed to work / what kind of output do you expect? In case this isn't clear: Neither duplicating nor dropping frames is possible with -codec copy, not even for rawvideo. (Duplicating and / or dropping is the desired effect of the output option -r.) Carl Eugen
2016-05-29 10:40 GMT+02:00 Carl Eugen Hoyos <cehoyos@ag.or.at>:
gf <fortyman <at> gmx.de> writes:
ffmpeg -f lavfi -i color=d=10 -r 50 -c copy test2.avi
How is this supposed to work / what kind of output do you expect? In case this isn't clear: Neither duplicating nor dropping frames is possible with -codec copy, not even for rawvideo. (Duplicating and / or dropping is the desired effect of the output option -r.)
Carl Eugen
Hm, I still don't seem to understand what the -r flag does in this case then. why is -i color=d=10:r=50 different from -i color=d=10 -r 50 ?
gf wrote:
2016-05-29 10:40 GMT+02:00 Carl Eugen Hoyos <cehoyos@ag.or.at>:
gf <fortyman <at> gmx.de> writes:
ffmpeg -f lavfi -i color=d=10 -r 50 -c copy test2.avi
How is this supposed to work / what kind of output do you expect? In case this isn't clear: Neither duplicating nor dropping frames is possible with -codec copy, not even for rawvideo. (Duplicating and / or dropping is the desired effect of the output option -r.)
Carl Eugen
Hm, I still don't seem to understand what the -r flag does in this case then. why is -i color=d=10:r=50 different from -i color=d=10 -r 50 ?
It's a different r :r=50 is a suboption of color which tells it to generate 50 fps. the -r 50 is an option that tells ffmpeg you want the output to be converted to 50 fps by dup/drop - but it doesn't work with copy. If you use -r before -i it has a different effect from after, on normal files = override whatever the input file framerate is.
It's a different r :r=50 is a suboption of color which tells it to generate 50 fps. the -r 50 is an option that tells ffmpeg you want the output to be converted to 50 fps by dup/drop - but it doesn't work with copy.
If you use -r before -i it has a different effect from after, on normal files = override whatever the input file framerate is.
Got it, thank you Carl and Andy!
Andy Furniss <adf.lists <at> gmail.com> writes:
If you use -r before -i it has a different effect from after, on normal files = override whatever the input file framerate is.
This is correct but I'd like to add that the input option -r does not always work;-( Carl Eugen
gf <fortyman <at> gmx.de> writes:
why is -i color=d=10:r=50 different from -i color=d=10 -r 50 ?
I'd like to add (Andy's explanation was completely correct) that I consider it a huge advantage that the input option -r, the output option -r and the framerate option of the color filter (that are all different options) all use the same character, it makes remembering the options much easier. Carl Eugen
participants (3)
-
Andy Furniss -
Carl Eugen Hoyos -
gf