[FFmpeg-user] concatenate png files for different durations?

Nicolas George george at nsup.org
Sun Mar 16 21:24:58 CET 2014

Le tridi 23 ventôse, an CCXXII, Spencer Graves a écrit :
>       How can I display a sequence of png files for different time
> durations and mate them with a single audio?
>       Attached is a toy example:  I want to display tst1.png for 0.5
> seconds followed by tst2.png for 1.5 seconds and merge that video
> with the audio in tst2.mp2.
>       If I don't care about the display time for each image, I can
> merge these 2 png and 1 mp2 files with "ffmpeg -y -r 1 -i tst.mp2 -r
> 2 -i tst%d.png -b 300k tst.mp4".
>       The documentation describes "concat" for filter, demuxer,
> protocol, and raw.  I was unable to see how any of these would solve
> this problem.

I believe you can implement what you need using the concat demuxer, with a
file like this:

file tst1.png
duration 0.5
file tst2.png
duration 1.5

Note that the duration of the last frame is discarded by ffmpeg, so you
probably need to add a dummy last frame (possibly the same as the real last
one) with a very short duration to mark the time.

Adding the audio is orthogonal to the video and duration issue, just add a
second input to the ffmpeg command-line tool.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/a80d214b/attachment.asc>

More information about the ffmpeg-user mailing list