在ffmpeg中将2个音频文件与视频合并

Mou*_*ily 1 audio video merge ffmpeg

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.

This is what i have tried :

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
Run Code Online (Sandbox Code Playgroud)

The CMD output for that is :

在此处输入图片说明

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

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

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

Gya*_*yan 6

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

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
Run Code Online (Sandbox Code Playgroud)

  • @Gyan 我如何调整 A1 和 A2 的音量? (2认同)
  • ““ [1]体积= 0.5 [a1]; [2]体积= 0.2 [a2]; [a1] [a2] amix = inputs = 2 [a]” (2认同)