在ffmpeg中将2个音频文件与视频合并 [英] Merging 2 audios files with a video in ffmpeg

查看:1474
本文介绍了在ffmpeg中将2个音频文件与视频合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将2个音频文件.WAV与1个视频文件.MP4合并,以使用Windows中的CMD.MP4扩展名生成输出.

I'm trying to merge 2 audio file .WAV with 1 video file .MP4 to produce the output in .MP4 extension using CMD in Windows.

这是我尝试过的:

ffmpeg -i V.MP4 -i A1.WAV -i A2.WAV -map 0:v -map 1:a -map 2:a -c:v copy -vcodec copy Output.MP4

CMD的输出是:

此命令将输出Output.MP4文件,但它将仅将视频与1个音频文件(A2.WAV)合并,并忽略其他音频文件A1.WAV

This command will output the Output.MP4 file but it will merge the video with only 1 of the audio files which is A2.WAV and ignores the other audio file A1.WAV

现在我想合并而无需重新编码而没有任何偏移,只需合并3个文件,就像它们在文件.MP4文件中一样.

Now i want to merge without re-encoding without any offset, just merge the 3 files like they are in a file .MP4 file.

我在此处检查了stackoverflow中的一些主题,例如,但它们没有帮助.

I checked some topics here in stackoverflow like this and this but they didn't help.

推荐答案

为了混合音频,您应该使用amix过滤器

In order to mixdown the audio, you should use the amix filter

ffmpeg -i V.MP4 -i A1.WAV -i A2.WAV -filter_complex "[1][2]amix=inputs=2[a]" -map 0:v -map "[a]" -c:v copy Output.MP4

这篇关于在ffmpeg中将2个音频文件与视频合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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