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

Spencer Graves spencer.graves at prodsyse.com
Sun Mar 16 22:35:54 CET 2014


On 3/16/2014 1:24 PM, Nicolas George wrote:
> 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


       Thanks for the reply.  Unfortunately, I've been unable so far to 
make it work.  Consider the following:


 >ffmpeg -y concat -i concat1.txt tst2e.mp4
ffmpeg version N-61163-gd1122b7 Copyright (c) 2000-2014 the FFmpeg 
developers
   built on Mar  7 2014 22:01:29 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads 
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r 
--enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca 
--enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug 
--enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg 
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr 
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab 
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx 
--enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid 
--enable
-zlib
   libavutil      52. 66.101 / 52. 66.101
   libavcodec     55. 52.102 / 55. 52.102
   libavformat    55. 33.101 / 55. 33.101
   libavdevice    55. 11.100 / 55. 11.100
   libavfilter     4.  3.100 /  4.  3.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 18.100 /  0. 18.100
   libpostproc    52.  3.100 / 52.  3.100
Input #0, tty, from 'concat1.txt':
   Duration: 00:00:00.04, bitrate: 17 kb/s
     Stream #0:0: Video: ansi, pal8, 640x400, 25 fps, 25 tbr, 25 tbn, 25 tbc
[NULL @ 02c4eec0] Unable to find a suitable output format for 'concat'
concat: Invalid argument


       Any idea what I'm doing wrong?  I tried several variations of the 
ffmpeg command and contents of concat1.txt with essentially the same 
result.


       Thanks again,
       Spencer
>
> 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.
>
> Regards,
>
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list