I am trying to overlay an input video with many images where each image should be shown for a short time. I achieved this using complex filter (the command below). The problem is that I have many, many images (>1000) :-)
ffmpeg -y -i in.mp4
-i logo1.png
-i logo2.png
-i logo3.png
-filter_complex "
[0:v][1:v] overlay=10:10:enable='between(n,2,4)' [tmp];
[tmp][2:v] overlay=30:30:enable='between(n,6,8)' [tmp];
[tmp][3:v] overlay=50:50:enable='between(n,10,12)';
" out.mp4
Does FFmpeg allows a user to pass this data over a text-file ? The images are generated in memory, so pipes are also fine (in fact preferred).
(if that is not possible can I pass raw generated video in Bgra format ?; but I would not prefer this because the blend operation is more expensive + more IO: has to be as fast as possible)
Edit: If I use the following configuration, only the last sent image is overlayed.
-i ski.mp4
-f image2pipe -vcodec png -i -
-filter_complex "[0:v][1:v] overlay=10:10:enable='between(n,2,3)' [tmp];
[tmp][1:v] overlay=30:30:enable='between(n,6,7)'"
-f mp4", "out.mp4"
FFmpeg outputs (it seems that it skips images if they have different sizes):
Input stream #1:0 frame changed from size:1417x665 fmt:rgba to size:1800x700 fmt:rgba
Input stream #1:0 frame changed from size:1800x700 fmt:rgba to size:550x371 fmt:rgba
Input stream #1:0 frame changed from size:550x371 fmt:rgba to size:256x256 fmt:rgba
How can I instruct FFmpeg that for the first filter uses 1st image, for the second 2nd image in pipe, etc. (the images have different sizes) ?