简体   繁体   中英

Adjust volume of both input mp3 files while merging using ffmpeg

I am using the following command to merge two audio files (mp3) into one output.mp3

-i /sdcard/NNR/input1.mp3 -i /sdcard/NNR/input2.mp3 
    -filter_complex amerge -ac 2 -c:a libmp3lame 
    -q:a 4 /sdcard/NNR/output.mp3

Kindly suggest me how to adjust volume level of both input files to some specific level.

I have found the following filter variable but don't exactly know how to adjust into my command.

ffmpeg -i a.mp3 -i b.mp3 
   -filter_complex "[0:a]volume=.25[A];[1:a][A]amerge[out]" 
   -map [out] -c:a pcm_s16le out.wav

Any help will be much appreciated.Thanks

You would use

-i /sdcard/NNR/input1.mp3 -i /sdcard/NNR/input2.mp3
-filter_complex "[0]volume=0.5,pan=2c[a];[1]volume=0.7,pan=2c[b];[a][b]amix=duration=shortest"
-ac 2 -c:a libmp3lame -q:a 4 /sdcard/NNR/output.mp3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM