FFmpeg 将一个视频叠加到另一个视频,混音,缩放叠加视频并将其定位在右下角

FFmpeg overlay one video to another, soung mixing, scale overlayed video and positioning it in right bottom corner

当我执行这个命令时:

ffmpeg -i screen.mp4 -i camera.mp4 -filter_complex "overlay=main_w-overlay_w-5:main_h-overlay_h-5" output2.mp4

我得到这个结果: result image from video

它几乎是完美的,除了一件事,我无法缩放我的覆盖视频(它在右下角)我需要把它缩小两倍。 感谢任何帮助!谢谢!

添加 scale and amix 过滤器。将 camera.mp4 减半并混合来自两个输入的声音的示例:

ffmpeg -i screen.mp4 -i camera.mp4 -filter_complex "[1:v]scale=iw/2:-1[cam];[0:v][cam]overlay=main_w-overlay_w-5:main_h-overlay_h-5;[0:a][1:a]amix" output.mp4