花了两个多小时,写的抖音去水印的脚本

ffmpeg  -i input.mp4 -vcodec copy -acodec copy -ss 00:00:00 -to 00:00:05 ./out1.mp4 -y
ffmpeg  -i input.mp4 -vcodec copy -acodec copy -ss 00:00:05 -to 00:00:15 ./out2.mp4 -y
pause


set left_logo_width = 280
set left_logo_heith = 100
@echo left_logo_width  = %left_logo_width %  ; left_logo_heith = %left_logo_heith %


set right_logo_width = 270
set right_logo_heith = 130
@echo right_logo_width  = %right_logo_width % ; right_logo_heith = %right_logo_heith %


set video_width = 408
set video_height = 720
@echo video_width = %video_width % ; video_height = %video_height %

pause

ffmpeg -i out1.mp4 -max_muxing_queue_size 1024 -vf "delogo=x=10:y=10:w=%left_logo_width %:h=%left_logo_heith %" -c:a copy output_delogo1.mp4

ffmpeg -i out2.mp4 -max_muxing_queue_size 1024 -vf "delogo=x=%video_width %-%right_logo_width %:y=%video_height %-%right_logo_heith %:w=%right_logo_width %-1:h=%right_logo_heith %-1" -c:a copy output_delogo2.mp4

pause


ffmpeg -i output_delogo1.mp4 -qscale:v 1 output_delogo1.mpg
ffmpeg -i output_delogo2.mp4 -qscale:v 1 output_delogo2.mpg
ffmpeg -i concat:"output_delogo1.mpg|output_delogo2.mpg" -c copy intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.mp4

del out1.mp4 out2.mp4 output_delogo1.mp4 output_delogo2.mp4 output_delogo1.mpg output_delogo2.mpg intermediate_all.mpg

你可能感兴趣的:(花了两个多小时,写的抖音去水印的脚本)