I have been having some issues with creating a VFR video from a sequence of images using ffmpeg.
I have 12 PNG images and their required durations listed in a concat file as:
So basically the timecodes are in a 80,80,90 ms pattern.Code:file '01.png' duration 0.08 file '02.png' duration 0.08 file '03.png' duration 0.09 file '04.png' duration 0.08 file '05.png' duration 0.08 file '06.png' duration 0.09 file '07.png' duration 0.08 file '08.png' duration 0.08 file '09.png' duration 0.09 file '10.png' duration 0.08 file '11.png' duration 0.08 file '12.png' duration 0.09
I use the following command to create the video:
However, when I extract the timecodes from the video using:Code:ffmpeg -f concat -i list.txt -c:v libx265 -crf 24 -an out.mkv
I get this:Code:mkvextract out.mkv timestamps_v2 0:time.txt
As you can see the durations have been changed to:Code:# timestamp format v2 0 80 160 240 320 400 520 600 680 760 840 920 960
Why does this happen and can it be corrected?Code:80 80 80 80 80 120 80 80 80 80 80 40
+ Reply to Thread
Results 1 to 11 of 11
80 millisecs !! You would hardly see the image !!
the duration format appears to be hh:mms.mmm so in your example it becomes 00:00:00.080 etc.
Both formats work. I also tested with 00:00:00.080, it gives the same result. Regarding the small duration, these are actually frames extracted from a gif.
Methinks you confuse what frame rate is. It's the number of frames played in a second - nothing to do with variable frame rate. And in your sample, which I already stated would run for one second, that is correct.
If you want more fps then increase the numbers for the video to play longer.
From what I understand the mkv container uses timecodes/durations (which says when and how long a frame is to be displayed) which need not be constant across all frames and as such allows one to effectively have a video with variable frame rate. Is this not correct?[/QUOTE]
That is not what variable frame rate typically means.
An encoder creates a video with some frames encoded at, for example, 15 frames per second and others, for example, at 30 frames per second. The actual encoding is variable - could NEVER apply to still images. And, again, absolutely nothing to do with how long those images play for in the video.
No doubt you could use ffmpeg to actually encode at, in it's proper sense, variable frame rate (setting a minimum and maximum) and I would bet my shirt on when you looked at the final video you would effectively still have a constant frame rate.
Any video that has timestamps (timecodes) that has a different display time for 1 or more frames is technically VFR .
"Display time" is how long the frame is shown, or "duration" of the frame
eg. 30.0 FPS CFR means each frame has a display time of ~33.333 ms (because 1/30 =~ 0.033333) . If one of the frames has slightly different display time, maybe 30ms, then it's VFR