Making mp3 louder than it is


$ ffmpeg -i 2019.9.16.mp3 -filter:a volumedetect -f null /dev/null
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[mp3 @ 0x5643824e1780] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '2019.9.16.mp3':
  Metadata:
    title           : copy
    date            : 2019-09-16 21:03
    id3v2_priv.XMP  : <?xpacket begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>\x0a<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c137 79.159768, 2016/08/11-13:24:42        ">\x0a <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\x0a  <rdf
  Duration: 01:29:35.62, start: 0.000000, bitrate: 40 kb/s
    Stream #0:0: Audio: mp3, 24000 Hz, stereo, fltp, 40 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
  Metadata:
    title           : copy
    date            : 2019-09-16 21:03
    id3v2_priv.XMP  : <?xpacket begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>\x0a<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c137 79.159768, 2016/08/11-13:24:42        ">\x0a <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\x0a  <rdf
    encoder         : Lavf58.45.100
    Stream #0:0: Audio: pcm_s16le, 24000 Hz, stereo, s16, 768 kb/s
    Metadata:
      encoder         : Lavc58.91.100 pcm_s16le
size=N/A time=01:29:35.59 bitrate=N/A speed=1.15e+03x    
video:0kB audio:503962kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[Parsed_volumedetect_0 @ 0x564382508400] n_samples: 258028416
[Parsed_volumedetect_0 @ 0x564382508400] mean_volume: -34.8 dB
[Parsed_volumedetect_0 @ 0x564382508400] max_volume: -2.8 dB
[Parsed_volumedetect_0 @ 0x564382508400] histogram_2db: 4
[Parsed_volumedetect_0 @ 0x564382508400] histogram_3db: 28
[Parsed_volumedetect_0 @ 0x564382508400] histogram_4db: 78
[Parsed_volumedetect_0 @ 0x564382508400] histogram_5db: 160
[Parsed_volumedetect_0 @ 0x564382508400] histogram_6db: 303
[Parsed_volumedetect_0 @ 0x564382508400] histogram_7db: 614
[Parsed_volumedetect_0 @ 0x564382508400] histogram_8db: 1145
[Parsed_volumedetect_0 @ 0x564382508400] histogram_9db: 2008
[Parsed_volumedetect_0 @ 0x564382508400] histogram_10db: 3677
[Parsed_volumedetect_0 @ 0x564382508400] histogram_11db: 6499
[Parsed_volumedetect_0 @ 0x564382508400] histogram_12db: 10928
[Parsed_volumedetect_0 @ 0x564382508400] histogram_13db: 18545
[Parsed_volumedetect_0 @ 0x564382508400] histogram_14db: 30493
[Parsed_volumedetect_0 @ 0x564382508400] histogram_15db: 49895
[Parsed_volumedetect_0 @ 0x564382508400] histogram_16db: 80335
[Parsed_volumedetect_0 @ 0x564382508400] histogram_17db: 130183

Please teach me the meaning of the useful part. Thanks

So, you have:

Which means the loudest part of the mp3 is the 2.8 dB below the maximum waveform.

So you can amplify it by that amount:

ffmpeg -i input.mp3 -filter:a "volume=2.8dB" output.mp3

Louder than that is not possible, without distorting the sound.

However you also have:

mean_volume: -34.8 dB

Which means that on average, it is pretty quiet. So, if you need it louder than that, you’ll need to compress the waveform.

What a normal loud enough mp3 “max_volume” should be ?
What will be normal mean_volume that is suppose to be ?
Does compression is do able in ffmpeg ?
This is only voice audio, no music… shouldn’t distort that serious right ?

@Kresimir

I tried other mp3 files that are soft as well:

  1. max volume -2.8dB mean volume -34.8dB
  2. max volume -4.4dB mean volume -37.3dB
  3. max volume -1.7dB mean volume -38.6dB

also tried 2 files that is loud enough

  1. max volume 0dB mean volume -18.8dB
  2. max volume 0dB mean volume -15.9dB

I have no knowledge of dB. I don’t know what -15.9dB means. is that loud ? or -18.8dB is louder ?

It’s relative unit, in digital audio 0 is loudest (louder than 0 produces clipping and noise), so -15 is louder than -18

3 Likes

I just read thru the wiki and watched thru 4 youtube video explaining and example of decibels… well, at least 1 youtube video https://www.youtube.com/watch?v=1XUovxiTpVA shows how loud each certain value of decibel is.

But, they never show minus decibel in all the videos… You said in digital audio, 0 decibel is loudest. In the youtube videos, 0 decibel is silent… why so opposite ?
Well, at least now i understand now, the above mp3 files which is soft just by looking at them.

Great! thanks.

1 Like

No idea mate, just some random youtube video :laughing:

Besides, since it’s relative unit you can do whatever you want, it can be + / - / % - whatever, especially depending on relative to what you measure it, for example whisper or explosion…

But in digital audio it’s more or less always standard and goes from something like -96 dB (in case your audio file have 16 bit / 44.1 kHz which is CD and most .mp3, btw voice may be lower) to 0 dB…

Probably because it shows direction this way from minus to loudest zero, from silence to loudest.
You can read more in quantazion section, if interested https://en.wikipedia.org/wiki/Audio_bit_depth SNR is that range of available digital scale for volume levels.

More bits = more SNR (dB) = more quality :yum:
But that’s a lot of theory for question at hand :face_with_monocle:

:hear_no_evil: I think this is enough for me, i just want to get work done, not doing research or science. lol…
Thanks

However you said standard from -96dB to 0dB… Who is capable of hearing -96dB ? isn’t that so soft that it is virtually silence ?

No, well at least it depends on a lot of factors:

  1. Audio player
  2. Audio subsystem and it’s internal settings like OS-level mixer if you haven’t bypassed it
  3. Volume settings
  4. Volume settings on your audio-interface / amplifier
  5. Your Speakers / Headphones capabilities and quality
  6. Even conditions you’ve listen on, your room and how good it’s isolated (if it’s dead silent in the night you can obviously hear a lot more than at day with open window or at the airport field)

Ever noticed how you can listen same music on speakers and headphones and for example “hear more” silent or “non-existent” details on headphones?

Well…That’s just how it rolls :upside_down_face:

It really depends.

Even if you for example try to listen exactly same material with exactly same conditions including volume and with exactly same headphones models, but one would have impedance of 16 Ohm and other would have let’s say 120 Ohm…

First one would scream in your ear, and second you would perceive generally as super-low volume and would need some serious amp to actually properly use them :grinning:

P.S. btw, if human is inserted in completely dead-silent room, anyone will start to hear even how blood pumping through veins pretty loud after few minutes of adaptation (creepy i know :laughing:), so humans are quite capable of hearing stuff :upside_down_face:

2 Likes

thanks for shearing this info.