FFmpeg:使用淡入淡出 in/out 效果向视频添加多个叠加层。命令有效,但图像(覆盖)未显示在视频中

FFmpeg: Adding multiple overlays to the video with the fade in/out effect. Command works but the images ( overlays ) doesn't show in the video

我正在尝试向视频添加多个叠加层并分别淡化 in/out 它们。因此,该命令没有任何问题,但在视频中,我看不到叠加图像

这是我尝试使用的命令

ffmpeg -y -i video.mp4 -loop 1 -i text1.png -loop 1 -i text2.png -loop 1 -i text3.png -loop 1 -i text4.png -loop 1 -i text5.png -filter_complex "
[1]fade=st=0:d=4:alpha=1,fade=out:st=2:d=1:alpha=1,trim=0:3,setpts=PTS+5/TB[ovr1];
[2]fade=st=0:d=4:alpha=1,fade=out:st=2:d=1:alpha=1,trim=0:3,setpts=PTS+10/TB[ovr2];
[3]fade=st=0:d=4:alpha=1,fade=out:st=2:d=1:alpha=1,trim=0:3,setpts=PTS+15/TB[ovr3];
[4]fade=st=0:d=4:alpha=1,fade=out:st=2:d=1:alpha=1,trim=0:3,setpts=PTS+20/TB[ovr4];
[5]fade=st=0:d=4:alpha=1,fade=out:st=2:d=1:alpha=1,trim=0:3,setpts=PTS+25/TB[ovr5];
[0:v][ovr1]overlay=0:0:enable='between(t,0,5)'[base1];
[base1][ovr2]overlay=0:(main_h-overlay_h)/2:enable='between(t,5,10)'[base2];
[base2][ovr3]overlay=0:(main_h-overlay_h)/2:enable='between(t,10,15)'[base3];
[base3][ovr4]overlay=0:(main_h-overlay_h)/2:enable='between(t,15,20)'[base4];
[base4][ovr5]overlay=0:(main_h-overlay_h)/2:enable='between(t,20,25)'[out]" -map "[out]" -c:v libx264 -c:a copy -flags +global_header -shortest with_overlays.mp4

你能帮我找出我做错了什么吗?

您的时间戳偏移错误,例如

[1]...setpts=PTS+5/TB[ovr1];[0:v][ovr1]overlay=0:0:enable='between(t,0,5)'[base1];,因此流在覆盖启用范围之后开始。应该是setpts=PTS+0/TB。类似地,将所有偏移量减少 5。