[FFmpeg-user] Multiple overlays at specific times

Michael Koch astroelectronic at t-online.de
Sun Dec 17 00:36:18 EET 2023


Am 16.12.2023 um 19:51 schrieb emmanuel martin:
> I have two inputs that are the same image. The first one, I loop to create
> a video for 8 seconds. I also create two streams that I will overlay. The
> background is the normal video, and above it is the same video with a LUT
> (Look-Up Table) that I applied earlier. I make the top video appear as an
> overlay with a fade-in effect that lasts x seconds before reaching 100%. To
> create a 'flash' effect, I want to overlay instances of my base image
> (participant1.jpg) at different very close intervals. The first overlay
> displays, but not this one
> "[out][1]overlay=enable='between(t,3.25,3.26)'[outv]", and I can't figure
> out the reason. Have I made a mistake somewhere? Thank you very much for
> your valuable advice :)
>
> ffmpeg -loop 1 -i participant1.jpg -i participant1.jpg -filter_complex "\
> [0]split=2[v1][v2];\
> [v2]format=rgba,lut3d='red.cube'[v3];\
> [v3]fade=in:st=0.25:d=2.93:alpha=1[ov];\
> [v1][ov]overlay[bg];\
> [bg][1]overlay=enable='between(t,3.20,3.21)'[out];\
> [out][1]overlay=enable='between(t,3.25,3.26)'[outv]"\
>   -map "[outv]" -c:v libx264 -t 8 -pix_fmt yuv420p output.mp4

The default framerate is 25. Time from one frame to the next is 0.04s.
The 80th frame has timestamp 80*0.04 = 3.20s
The 81th frame has timestamp 81*0.04 = 3.24s
The 82th frame has timestamp 82*0.04 = 3.28s
Which means there is a frame in the [3.20 .. 3.21] interval, but there 
is no frame in the [3.25 .. 3.26] interval.

Michael



More information about the ffmpeg-user mailing list