FFMPEG调节音频的音量大小,混音

找了很久,国内网站没有,最后还是用google到ffmpeg论坛,找到了。

http://ffmpeg.gusari.org/viewtopic.php?f=25&t=517


防止论坛倒闭,在这里备份下:

 How to change audio volume up / down with FFmpeg?

by screenshaper » Thu Oct 16, 2014 6:50 pm 

This thread is OUTDATED
Later -af option has been implemented!

Now this command
CODE:  SELECT ALL
ffmpeg -i input.wav -af volume=-3dB output.wav
is perfectly working

See ticket #725


这个就是volume减掉3db。


还有一种:


To increase the volume with ffmpeg use the commad: 

ffmpeg -i input.wav -af 'volume=2' output.wav

Replace volume=X with a suitable number. For example 0.5 will half, 2 will double the volume.


========================


To get volume level of the media file in command line I use:

ffmpeg -i audo.mp3 -af "volumedetect" -f null /dev/null

in the output I see something like this:

[Parsed_volumedetect_0 @ 0000000004087260] n_samples: 41316480
[Parsed_volumedetect_0 @ 0000000004087260] mean_volume: -22.5 dB
[Parsed_volumedetect_0 @ 0000000004087260] max_volume: -5.8 dB
[Parsed_volumedetect_0 @ 0000000004087260] histogram_5db: 3
[Parsed_volumedetect_0 @ 0000000004087260] histogram_6db: 892
[Parsed_volumedetect_0 @ 0000000004087260] histogram_7db: 8686
[Parsed_volumedetect_0 @ 0000000004087260] histogram_8db: 36098



你可能感兴趣的:(FFmpeg)