问题描述
我想要 2 个带有屏幕效果的视频叠加(在 photoshop、aftereffect、canvas 等中已知)
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "blend=screen" output.mp4
我想要的是预期的
PS 2 影片输入尺寸相同
解决方法
添加 format filter 为每个输入使用 gbrp 像素格式,使用 all_mode
blend filter 选项,然后再次使用格式过滤器输出 yuv420p 像素格式以实现一般 MP4 播放兼容性:
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0]format=gbrp[fg];[1]format=gbrp[bg];[fg][bg]blend=all_mode=screen,format=yuv420p" output.mp4