I create a video of still images by this ffmpeg command.

ffmpeg -r 25 -i a%03d.jpg -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4

I want to keep the last image for additional n seconds. Currently, I copy the last image n*25 times and put them at the end of the image sequence.

However, I think it is not the correct way. Is it possible to tell ffmpeg to read the last image n*25 times?

2 Answers 2


You can use tpad filter like this :

ffmpeg -r 25 -i a%03d.jpg -c:v libx264 -vf tpad=stop_mode=clone:stop_duration=2,fps=25 -pix_fmt yuv420p out.mp4


n = your desired duration in Seconds.


Coping the still image is indeed the correct way to duplicate frames in a video. All video is a series of still images stacked and played back at a rate fast enough to give the appearance of motion. If you want any single frame (still image) to appear for more than a single frame tick, then you need to duplicate that frame. The encoder doesn't know what the content of each frame is, only how many frames it needs to encode into the video format.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .