第一个命令——给我的视频添加水印:
"-y", "-i", videoUrl, "-strict", "experimental", "-vf", "movie=" + watermarkImagePath + "[watermark];[in][watermark]overlay=15:main_h-overlay_h[out]", "-s", "360*480", "-r", "20", "-b", "15496k", "-vcodec", "mpeg4", "-ab", "48000", "-ac", "2", "-ar", "22050", outputVideoUrl
第二条命令 - 将其他视频与带水印的视频连接起来(第一条命令视频作为输入):
"-i",inputFile1,"-i",inputFile2,"-v","debug","-strict”,”-2”,”-filter_complex","[0:v][0:a:0][1:v][1:a:0]concat=n=2:v=1:a=1[v][a]","-map","[v]","-map","[a]",outUrl
请帮助将其合并为单个命令。
答案1
使用分号 ( ;
) 连接单独的过滤链。
ffmpeg -i video0 -i video1 -i image -filter_complex
"[0:v][2:v]overlay=15:main_h-overlay_h[over];
[over][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]"
-map "[v]" -map "[a]" output
无需电影源过滤器。只需将覆盖图像添加为普通输入即可。