FFMPEG视频转码常用命令

/ 0评 / 0
单个压制代码

ffmpeg -i 480P.mp4 -i logo.png -crf 26 -b:a 128k -filter_complex "[0:v]scale=864:-1[bg];[bg][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10,ass=test.ass" 1704.mp4


批量压制代码
for %a in ("*.mp4") do ffmpeg -i "%a" -i logo.png -crf 26 -b:a 128k -filter_complex "[0:v]scale=864:-1[bg];[bg][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10,ass=test.ass" "newfiles\%~na.mp4"

for %a in ("*.mp4") do ffmpeg -i "%a" -i logo.png -crf 23 -b:a 128k -filter_complex "[0:v]scale=1280:-1[bg];[bg][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10,ass=test.ass" "newfiles\%~na.mp4"

批量压制代码添加字幕
for %a in ("*.mp4") do ffmpeg -i "%a" -crf 23 -b:a 128k  -vcodec libx264 -preset fast  -y -vf "ass=test.ass" "newfiles\%~na.mp4"

右上角
for %a in ("*.mp4") do ffmpeg -i "%a" -i logo1.png -crf 26 -b:a 128k -filter_complex "[0:v]scale=960:540[bg];[bg][1:v]overlay=main_w-overlay_w-40:10,ass=test.ass" "newfiles\%~na.mp4"

左上角
for %a in ("*.mp4") do ffmpeg -i "%a" -i logo2.png -crf 26 -b:a 128k -filter_complex "[0:v]scale=864:-1[bg];[bg][1:v]overlay=10:10,ass=test.ass" "newfiles\%~na.mp4"

右下角
for %a in ("*.mp4") do ffmpeg -i "%a" -i logo2.png -crf 26 -b:a 128k -filter_complex "[0:v]scale=864:-1[bg];[bg][1:v]overlay=main_w-overlay_w-10 : main_h-overlay_h-10,ass=test.ass" "newfiles\%~na.mp4"

水印图片位置
overlay值
左上角
10:10
右上角
main_w-overlay_w-10:10
左下角
10:main_h-overlay_h-10
右下角
main_w-overlay_w-10 : main_h-overlay_h-10

发表评论

电子邮件地址不会被公开。 必填项已用*标注