Development User Help

Slideshow with ffmpeg results in stuttery, unseekable, incorrect length file

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?

Leave a Reply

Your email address will not be published. Required fields are marked *