I have multiple (> 100) videos with various constant frame rates (e.g. 7 FPS, 8 FPS, 16 FPS, 25 FPS) but same codecs and resolutions.
I want to concatenate (using ffmpeg concat) them into one video with a variable frame rate (VFR), so that the concatenated video plays every part with the respective framerate.
Until now, I only managed to concat all files to a single video with a constant (CFR) of eg. 25 FPS.
This as the downside, that all parts with <25 FPS play faster.
I use -vsync 2 -r 25
to try to tell ffmpeg to use VFR with a maximum FPS of 25, but mediainfo
reports a video with CFR of 25 FPS.
If I just use -vsync 2
(without -r
), I get a VFR video output, but, mediainfo
reports that it is a video with minimum 11.9 FPS and maximum 12 FPS (so kind of mean FPS of all videos).
How do I concat various videos to a single VFR video?
Here is the command I used:
ffmpeg -y -vsync 2 -r 25 -f concat -safe 0 -i /tmp/filelist.txt -c:v h264_omx -pix_fmt yuv420p -b:v 524231 -maxrate 524231 -bufsize 1048462 -an /tmp/${DATE}.mp4
I use ffmpeg version 3.2.12-1~deb9u1+rpt
on (Raspbian 6.3.0-18+rpi1+deb9u1