在应用drawbox和drawtext文本选项之前,我能够轻松淡入和淡出图像。但是,尝试合并绘图文本会产生不必要的错误。有什么想法可以解决?喜欢在特定时间以框为中心显示多行文本(不同字体),而淡入淡出时间则与图像在特定时间淡出同时工作。
ffmpeg -i vids / testVid.mp4 -loop 1 -i slideshow / pic1.png -loop 1 -i slideshow / pic2.png -loop 1 -i slideshow / pic3.png -i slideshow / pic4.png -filter_complex “ [0:v] drawbox = x = 40:y = 40:w = 250:h = 75:color = white,drawtext = fontfile = arialb.ttf:fontsize = 24:font color = black:text = Micky Mouse, drawtext = fontfile = arial.ttf:fontsize = 24:字体颜色=黑色:text = 1938年1月1日至2019年12月19日fade = st = 0:d = 1:alpha = 1,fade = out:st = 5:d = 1:alpha = 1,trim = 0:6,setpts = PTS + 4 / TB [ovr1]; [2] fade = st = 0:d = 1:alpha = 1,fade = out:st = 5:d = 1:alpha = 1,trim = 0:6,setpts = PTS + 10 / TB [ovr2]; [3] fade = st = 0:d = 1:alpha = 1,fade = out:st = 5:d = 1:alpha = 1,trim = 0:6,setpts = PTS + 16 / TB [ovr3]; [4] fade = st = 0:d = 1:alpha = 1,fade = out:st = 5:d = 1:alpha = 1,trim = 0:6,setpts = PTS + 22 / TB [ovr4]; [0:v] [ovr1] overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2:启用='between(t,4,10)'[base1]; [base1] [ovr2] overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2:enable ='between(t,10,16) '[base2]; [base2] [ovr3] overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2:enable ='介于(t,16,22)'[base3]; [base3] [ovr4] overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2:enable ='between(t,22,28)'[out]“ -map” [out]“ -c: v libx264 -c:复制-flags + global_header -crf 27-非常快速地预设-s 1920x1080 -y slideshow / outTest.mp4