[FFmpeg-user] Overlay a video with a image at multiple offsets and of varying duration?

Moritz Barsnick barsnick at gmx.net
Thu Jan 7 10:44:12 CET 2016


On Thu, Jan 07, 2016 at 12:16:55 +1100, Ryan Williams wrote:

Please don't top-post.

> I suspect you have a syntax error in your filter_complex with use of double quotes.

No, the double quotes only protect the single quotes and whitespace
from the shell. Vic is free to keep that single comma outside of the
quotes. (This *should* also apply to Windows "DOS box" shell.)

Vic wrote:
> > However, when I create a command line for FFMPEG that should
> > overlay the image on the frames from 1-5 seconds and 10-20 seconds
> > the command below fails with the error "Cannot find a matching
> > stream for unlabeled input pad 0 on filter Parsed_overlay_1". I
> > thought that filter chains take as input the previous filter's
> > output but obviously not how I have constructed it.

They do, but your first overlay takes two inputs to create one output,
and you chain that one output to the subsequent overlay as input. But
that again needs two inputs. A complex filter, as Ryan proposed, does
do this correctly:

> give this a try -filter_complex "[0][1]overlay=enable='between(t,1,5)'[tmp]; [tmp][1]overlay=enable='between(t,10,20)'"

Moritz


More information about the ffmpeg-user mailing list