I have a set of images from which I try to create a slide show. On this website I found the following command to do so:
ffmpeg -framerate 1/5 -start_number 126 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
I got it working fine. But in my case I need to have each images to be displayed a different period of time. How can I achieve this?
So it is some time ago I asked this question an there is no answer yet. I also did not find one by myself. I solved the task in my case by creating simbolic links for each frame pointing to the correct image. Then I set the framerate to 1. So for each second I want to display an image I have a symbolic link pointing to it.
One can of course also just copy the files accordingly. Depending on the total number of frames of the video this can result in a lot of disk space used. So I went with the links.
You can try the concat demuxer and provide the duration for each frame.
Make text file containing the path to your inputs and the duration for each:
Then run
ffmpeg
:Notes:
See the concat demuxer documentation for more info.
The example won't work with an old
ffmpeg
, so make sure to download a recent build first since FFmpeg development is so active.