去LOGO水印:
ffmpeg -i test.mp4 -filter_complex "delogo=x=850:y=500:w=160:h=70:show=0" delogo.mp4
加文字:
ffmpeg -i test.mp4 -vf "drawtext=fontfile=MicroYaHei.ttf:text=雪人制造:x=60:y=60:fontsize=24:fontcolor=#FFFFFF@0.8" -y drawtext_out.mp4
添加LOGO水印:
左上角:ffmpeg -i output.mp4 -i pptv.png -filter_complex overlay output3.mp4
右上角:ffmpeg -i output.mp4 -i pptv.png -filter_complex overlay=W-w output4.mp4
左下角:ffmpeg -i output.mp4 -i pptv.png -filter_complex overlay=0:H-h output5.mp4
右下角:ffmpeg -i output.mp4 -i pptv.png -filter_complex overlay=main_w-overlay_w-10:main_h-overlay_h-10 output6.mp4
居中:ffmpeg -i output.mp4 -i pptv.png -filter_complex overlay='(main_w/2)-(overlay_w/2):(main_h/2)-(overlay_h)/2' center.mp4
录屏:
ffmpeg -framerate 30 -f gdigrab -i desktop -vcodec libx264 -pix_fmt yuv420p -y output.mkv
同时添加多个水印:
ffmpeg -i aaa.mp4 -i logo.png -i logo.png -i logo.png -i logo.png -i logo.png -filter_complex overlay = 10 :10,overlay= 10 :main_h-overlay_h-10,overlay= main_w-overlay_w-10:10,overlay= main_w-overlay_w-10:main_h-overlay_h-10,overlay= main_w/2-overlay_w/2:main_h/2-overlay_h/2 aaa1.mp4
同时添加文字和LOGO水印:
ffmpeg -i test.mp4 -vf "[in]drawtext=fontfile=MicroYaHei.ttf:text=hello world:x=60:y=60:fontsize=24:fontcolor=#FFFFFF@0.8[text];movie=logo.png[wm];[text][wm]overlay=W-w-10:H-h-10[out]" -y drawtext_out.mp4
同时去LOGO再添加文字和水印:
ffmpeg -i test.mp4 -vf "[in]delogo=850:500:160:70:0[delogo];[delogo]drawtext=fontfile=MicroYaHei.ttf:text=hello world:x=60:y=60:fontsize=24:fontcolor=#FFFFFF@0.8[text];movie=logo.png[wm];[text][wm]overlay=W-w-10:H-h-10[out]" -y drawtext_out.mp4