0
I'm using ffmpeg
to show images for different durations in a video:
(command taken from example on this page)
ffmpeg -f concat -i input.txt -vsync vfr -pix_fmt yuv420p output.mp4
Here what input.txt
roughly looks like:
file '/path/to/im1.png'
duration 123
file '/path/to/im2.png'
duration 234
file '/path/to/im3.png'
duration 235
file '/path/to/im4.png'
duration 400
file '/path/to/im4.png'
The resulting file has trouble playing back in mpv
, Movies and TV
(windows), and VLC
. On a hunch, I ran the file through ffmpeg
again to see I could 'fix' the output file (command used: ffmpeg -i in.mp4 out.mp4
). out.mp4
was much larger than in.mp4
(around an order of magnitude), but played smoothly, showed progress correctly, and was able to seek properly. What could be the reason for this?
Ahh, so if I'm understanding correctly it's kinda the players faults for not handling this valid, but weird video? – Matt M. – 2020-02-15T06:40:35.510
You could say that, but fault is a harsh term. Any software will be designed for vanilla and common edge cases. – Gyan – 2020-02-15T06:44:44.340
Strangely enough, running my original command and then passing it through ffmpeg again is faster then just using
-vsync cfr
(around 4x faster) – Matt M. – 2020-02-15T06:46:20.240Vsync cfr is default for mp4 output. The difference will be due to the framerate. – Gyan – 2020-02-15T07:08:45.640