Changes between Initial Version and Version 1 of AudioVolume


Ignore:
Timestamp:
Aug 4, 2017, 2:03:47 PM (2 years ago)
Author:
slhck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AudioVolume

    v1 v1  
     1= Audio Volume Manipulation =
     2
     3== Changing volume ==
     4
     5To change the audio volume, you may use FFmpeg's [http://ffmpeg.org/ffmpeg.html#volume volume] audio filter.
     6
     7If we want our volume to be half of the input volume:
     8{{{
     9ffmpeg -i input.wav -filter:a "volume=0.5" output.wav
     10}}}
     11
     12150% of current volume:
     13{{{
     14ffmpeg -i input.wav -filter:a "volume=1.5" output.wav
     15}}}
     16
     17You can also use decibel measures:
     18{{{
     19ffmpeg -i input.wav -filter:a "volume=10dB" output.wav
     20}}}
     21
     22== Peak and RMS Normalization ==
     23
     24To normalize the volume to a given peak or RMS level, the file first has to be analyzed using the `volumedetect` filter:
     25
     26{{{
     27ffmpeg -i input.wav -filter:a volumedetect -f null /dev/null
     28}}}
     29
     30Read the output values from the command line log:
     31
     32{{{
     33[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] mean_volume: -16.0 dB
     34[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] max_volume: -5.0 dB
     35...
     36}}}
     37
     38... then calculate the required offset, and use the `volume` filter as shown above.
     39
     40To automate this process and run it on multiple files (including video), you can also use the [https://github.com/slhck/ffmpeg-normalize ffmpeg-normalize Python script] via `pip install ffmpeg-normalize`. For the supported options, see `ffmpeg-normalize -h`.
     41
     42== Loudness Normalization ==
     43
     44If you want to normalize the (perceived) loudness of the file, use the [http://ffmpeg.org/ffmpeg-filters.html#loudnorm loudnorm] filter, which implements the EBU R128 algorithm:
     45
     46{{{
     47ffmpeg -i input.wav -filter:a loudnorm output.wav
     48}}}
     49
     50This is recommended for most applications, as it will lead to a more uniform loudness level compared to simple peak-based normalization.