此命令用于将视频添加到视频:
ffmpeg -i 1.mp4 -i over.mp4 -filter_complex “ [0:v] setpts = PTS-STARTPTS,比例= 224x400 [top]; [1:v] setpts = PTS-STARTPTS,比例= 100x44 [bottom]; [top] [bottom] overlay = x = 115:y = 346:eof_action = pass; [0]体积= 0.7 [a1]; [1]体积= 0.3 [a2]; [a1] [a2] amix = inputs = 2 [a]“ -acodec aac -vcodec libx264 -map 0:v -map“ [a]” out.mp4
此命令用于在视频中添加水印和用户名文本:
ffmpeg -i 1.mp4 -i watermark.png -filter_complex “ overlay = main_w-overlay_w-5:main_h-overlay_h-15,drawtext = fontfile = / path / to / font.ttf:text ='@ Unknown': fontcolor =白色:fontsize = 10:box = 1:boxcolor =黑色@ 0.0:boxborderw = 5: x = 160:y = 380“ -codec:副本output.mp4
如果我想一起执行这两个命令,那我该怎么办?或者我如何将这两个命令合而为一?
答案 0 :(得分:0)
在叠加层之后添加水印和绘画文字。
ffmpeg -i 1.mp4 -i over.mp4 -i watermark.png -filter_complex "[0:v]setpts=PTS-STARTPTS,scale=224x400[top];[1:v]setpts=PTS-STARTPTS,scale=100x44[bottom];[top][bottom]overlay=x=115:y=346:eof_action=pass[vid];[vid][2]overlay=main_w-overlay_w-5:main_h-overlay_h-15,drawtext=fontfile=/path/to/font.ttf:text=‘@Unknown': fontcolor=white: fontsize=10: box=1: boxcolor=black@0.0: boxborderw=5: x=160: y=380;[0]volume=0.7[a1];[1]volume=0.3[a2];[a1][a2]amix=inputs=2" -acodec aac -vcodec libx264 out.mp4