ffmpeg覆盖多个输出 [英] ffmpeg overlay on multiple outputs

查看:80
本文介绍了ffmpeg覆盖多个输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ffmpeg 3.4.1将高解析度的视频文件转码为几个较低的分辨率,并在拐角处带有徽标:

I'm using ffmpeg 3.4.1 to transcode a highres video file into several lower resolutions with a logo in the corner:

ffmpeg -i "test.mxf" -i "logo.png" ^
-filter_complex "[0:v][1:v] overlay" ^
-s 640x480 -c:v libx264 -b:v 1000K -c:a aac -b:a 96k "test.640x480K.1000K.logo.mp4" ^
-s 1280x720 -c:v libx264 -b:v 2200K -c:a aac -b:a 192k "test.1280x720K.2200K.logo.mp4"

但是这种方式在第一个输出文件中只有一个徽标.

But this way there is only a logo in the first output file.

我尝试使用地图,这在两个输出文件中都给了我徽标,但是声音消失了:

I have tried using map, this gives me logos in both output files but then the sound disappears:

ffmpeg -i "test.mxf" -i "logo.png" ^
-filter_complex "[0:v][1:v] overlay [output1]; [0:v][1:v] overlay [output2]" ^
-map [output1] -s 640x480 -c:v libx264 -b:v 1000K -c:a aac -b:a 96k "test.640x480K.1000K.logo.mp4" ^
-map [output2] -s 1280x720 -c:v libx264 -b:v 2200K -c:a aac -b:a 192k "test.1280x720K.2200K.logo.mp4"

我在做什么错了?

我想一口气做5个输出,以避免连续运行ffmpeg 5次.一口气应该更有效/更快.

I would like to do 5 outputs in one go to avoid running ffmpeg 5 times in succession. It ought to be more efficient/faster to do it in one go.

推荐答案

使用

ffmpeg -i "test.mxf" -i "logo.png" ^
-filter_complex "[0:v][1:v] overlay,split=2[a][b]" ^
-map [a] -map 0:a -s 640x480 -c:v libx264 -b:v 1000K -c:a aac -b:a 96k "test.640x480K.1000K.logo.mp4" ^
-map [b] -map 0:a -s 1280x720 -c:v libx264 -b:v 2200K -c:a aac -b:a 192k "test.1280x720K.2200K.logo.mp4"

这篇关于ffmpeg覆盖多个输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆