[FFmpeg-user] concat filter

Michael Henson michael at nextlogic.com.au
Fri Oct 26 08:19:35 CEST 2012


Hi,

ffmpeg version N-45574-gba31e59 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 15 2012 17:33:56 with gcc 4.7.2 (GCC) 20120921 (Red Hat 4.7.2-2)

I am trying to use the above version of ffmpeg to achieve the following:

1) fade from black to a jpeg image, hold for 1 second, fade out to black
2) fade from black to a video and play the video (including audio)
3) fade from the last frame of the video to a jpeg image
4) hold the jpeg image for 1 second, fade out to black

I managed to achieve this in a previous version by creating many
movies in PNG format (non-lossy) with alpha values and then blending
to get some of the fades, then using mencoder to concatenate (as I
couldn't figure out the mpeg4yuv? piping with PNG in ffmpeg), then
using ffmpeg to add audio back in (delayed using sox) and then output
to various formats.

I was hoping to simplify and speed this up using the new
filter_complex option, and concat filter. However I am struggling to
get the desired output.

I have tried to break the problem up into more manageable chunks to
figure it out.

The following command line will correctly play the video "a.mov" and
then fade from black to logo.jpg and then fade to black again. Which
is exactly what I asked for:

 ffmpeg -r 30 -loop 1 -i logo.jpg -i a.mov -t 14.48 -filter_complex
'[0:0]setsar=0:1,scale=480:360,fade=in:0:30,fade=out:60:30[top];[1:1]fade=in:0:30[mid];[mid][top]concat'
out.mpeg

However if I want to have the logo appear first, then the video, it
does not work. The command line is:

 ffmpeg -r 30 -loop 1 -i logo.jpg -i a.mov -t 14.48 -filter_complex
'[0:0]setsar=0:1,scale=480:360,fade=in:0:30,fade=out:60:30[top];[1:1]fade=in:0:30[mid];[top][mid]concat'
out.mpeg

Note that all that has changed is the order that the input pad's are
named for the concat filter. The result is that I get the fade to
logo, fade from logo, but then nothing but black (although I do get
audio).

Can someone please enlighten as to how to use the concat filter to get
what I want? Or is this not possible?

Thanks,

Michael.


More information about the ffmpeg-user mailing list