I'm making a video of 20 seconds at FPS=25, with 500 frames which are 0000.png, 0001.png, ..., 0499.png. This works:
ffmpeg -framerate 25 -i images/%04d.png out.mp4
but in fact there are only a few changes in the video, in my case at frames 0000, 0122, 0288, 0312, 0450. In the meantime the PNG are identical.
Problem: it's always slow to generate 500 PNG files when only 5 different files would be enough! I would like to generate only those 5 PNG files, and generate the video from them.
When I try the command above with images/ containing only 0000.png, 0122.png, 0288.png, 0312.png, 0450.png and not the 495 others, obviously it fails with:
[image2 @ 00000000006d4040] Could not open file : images/0001.png
Question: is there a way to tell ffmpeg to ignore missing frames and use the latest available frame instead of failing, when using -i images/%04d.png?
If not, what alternative is there to generate the video with only these 5 PNG that should arrive at a precise timeframe?