Merging 2 audios files with a video in ffmpeg

自古美人都是妖i 提交于 2020-01-14 03:21:06

问题


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

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.


回答1:


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


来源:https://stackoverflow.com/questions/50168993/merging-2-audios-files-with-a-video-in-ffmpeg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!