[FFmpeg-user] Can I create an mp4 with dwell?

Lou Logan lou at lrcd.com
Sun Mar 18 19:38:04 EET 2018

On Sat, Mar 17, 2018, at 11:41 AM, Geoff Fox wrote:
> I'm a meteorologist making my own weather maps.  I use ffmpeg to create my
> animations from still images, like this:
> Typically:  ffmpeg -r 10 -f image2 -s 1920x1080 -start_number 02 -i
> /var/www/html/output/hrrr/sfc/ord-hrrr-slp%02d.png -y -vframes 96 -vcodec
> libx264 -crf 25  -pix_fmt yuv420p
> /var/www/html/output/hrrr/sfc/ord-hrrr-slp.mp4
> It would save me a lot of time if I could build a half second dwell for the
> last frame.  Is this possible with ffmpeg?

By "dwell" I guess you mean a pause. One method is to use the concat filter:

ffmpeg -framerate 10 -start_number 02 -i ord-hrrr-slp%02d.png -framerate 10 -t 0.5 -loop 1 -i last_frame.png -filter_complex "[0][1]concat=n=2:v=1:a=0,format=yuv420p[v]" -map "[v]" output.mp4

Last image should display for a half second + 1 frame (I did not verify).

No need for "-f image2 -s 1920x1080".

Use -framerate instead of -r for the image file demuxer.

More information about the ffmpeg-user mailing list