Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.linux > #60851 > unrolled thread

normalize audio

Started byEmanuel Berg <moasenwood@zoho.eu>
First post2019-11-25 07:34 +0100
Last post2019-11-25 13:57 +0000
Articles 12 — 4 participants

Back to article view | Back to alt.os.linux


Contents

  normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-25 07:34 +0100
    Re: normalize audio Paul <nospam@needed.invalid> - 2019-11-25 02:10 -0500
      Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-27 06:40 +0100
        Re: normalize audio Paul <nospam@needed.invalid> - 2019-11-27 06:47 -0500
          Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-28 06:51 +0100
            Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-28 07:04 +0100
              Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-28 07:07 +0100
                Re: normalize audio Paul <nospam@needed.invalid> - 2019-11-28 06:29 -0500
                  Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-29 06:58 +0100
                    Re: normalize audio Emanuel Berg <moasenwood@zoho.eu> - 2019-11-29 07:05 +0100
                      Re: normalize audio Johann Beretta <beretta@nun-ya-bizness.com> - 2019-12-25 02:10 -0800
    Re: normalize audio William Unruh <unruh@invalid.ca> - 2019-11-25 13:57 +0000

#60851 — normalize audio

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-25 07:34 +0100
Subjectnormalize audio
Message-ID<86eexwbh1o.fsf@zoho.eu>
Anyone knows some good software to normalize
audio in a bunch of songs? m4a, webm and mp3
files.

I have normalize-audio which SOUNDS like it but
it seems it "adjusts" the same thing every time
I invoke it, also it doesn't support m4a or
webm.

TIA
        
-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [next] | [standalone]


#60852

FromPaul <nospam@needed.invalid>
Date2019-11-25 02:10 -0500
Message-ID<qrfupe$7qj$1@dont-email.me>
In reply to#60851
Emanuel Berg wrote:
> Anyone knows some good software to normalize
> audio in a bunch of songs? m4a, webm and mp3
> files.
> 
> I have normalize-audio which SOUNDS like it but
> it seems it "adjusts" the same thing every time
> I invoke it, also it doesn't support m4a or
> webm.
> 
> TIA
>         

Since "FFMPEG does everything", I would start there.

https://trac.ffmpeg.org/wiki/AudioVolume

    "Peak and RMS Normalization"

    "Loudness Normalization EBU R128"

You could also use it to calibrate your "normalize-audio"
process and measure the level once a file is processed
by it.

    Paul

[toc] | [prev] | [next] | [standalone]


#60873

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-27 06:40 +0100
Message-ID<86r21t512x.fsf@zoho.eu>
In reply to#60852
Paul wrote:

> Since "FFMPEG does everything", I would start there.
>
> https://trac.ffmpeg.org/wiki/AudioVolume
>
>    "Peak and RMS Normalization"
>
>    "Loudness Normalization EBU R128"

Hm, it seems ffmpeg-normalize produces mkv's
that are around 200M out of mp3's that are
2-4M...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#60874

FromPaul <nospam@needed.invalid>
Date2019-11-27 06:47 -0500
Message-ID<qrlno1$9ls$2@dont-email.me>
In reply to#60873
Emanuel Berg wrote:
> Paul wrote:
> 
>> Since "FFMPEG does everything", I would start there.
>>
>> https://trac.ffmpeg.org/wiki/AudioVolume
>>
>>    "Peak and RMS Normalization"
>>
>>    "Loudness Normalization EBU R128"
> 
> Hm, it seems ffmpeg-normalize produces mkv's
> that are around 200M out of mp3's that are
> 2-4M...
> 

What does ffprobe tell you about the "before" and "after" files ?

    ffprobe some.mp3

The codec used should be listed.

It would probably help, to specify the codec when
re-encoding the file with the normalize command. My
guess is, it's been converted into PCM or something.

There has to be an answer in there.

    Paul

[toc] | [prev] | [next] | [standalone]


#60891

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-28 06:51 +0100
Message-ID<86eexs1rbg.fsf@zoho.eu>
In reply to#60874
Paul wrote:

> What does ffprobe tell you about the "before"
> and "after" files ?
>
>    ffprobe some.mp3
>
> The codec used should be listed.

Size: 3.1M -> 157M

Encoder: google/video-file -> Lavf57.56.101 and dLavc57.64.101 pcm_s16le

Before:

 10 ~/mm/ed ll rollergirl-dear-jessie.webm 
-rw-r--r-- 1 incal incal 3.1M Jul 31 15:32 rollergirl-dear-jessie.webm
 10 ~/mm/ed ffprobe rollergirl-dear-jessie.webm 
ffprobe version 3.2.14-1~deb9u1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, matroska,webm, from 'rollergirl-dear-jessie.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:03:33.38, start: -0.007000, bitrate: 121 kb/s
    Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)

After:

 10 ~/mm/ed cd normalized
 10 ~/mm/ed/normalized ls
rollergirl-dear-jessie.mkv
 10 ~/mm/ed/normalized ll rollergirl-dear-jessie.mkv 
-rw-r--r-- 1 incal incal 157M Nov 28 06:45 rollergirl-dear-jessie.mkv
 10 ~/mm/ed/normalized ffprobe rollergirl-dear-jessie.mkv 
ffprobe version 3.2.14-1~deb9u1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, matroska,webm, from 'rollergirl-dear-jessie.mkv':
  Metadata:
    ENCODER         : Lavf57.56.101
  Duration: 00:03:33.38, start: 0.000000, bitrate: 6146 kb/s
    Stream #0:0(eng): Audio: pcm_s16le, 192000 Hz, 2 channels, s16, 6144 kb/s (default)
    Metadata:
      ENCODER         : Lavc57.64.101 pcm_s16le
      DURATION        : 00:03:33.375000000

> It would probably help, to specify the codec
> when re-encoding the file with the normalize
> command. My guess is, it's been converted
> into PCM or something.

Yes, PCM is mentioned in the normalized file:
pcm_s16le (twice). PCM = Pulse-code modulation,
<https://en.wikipedia.org/wiki/Pulse-code_modulation>

> There has to be an answer in there.

The truth is out there :)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#60892

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-28 07:04 +0100
Message-ID<86a78g1qqn.fsf@zoho.eu>
In reply to#60891
Re: audio normalization, one can get mp3s with
e.g. 'ffmpeg-normalize -c:a libmp3lame -ext mp3
lame-music.webm', did it just now
rollergirl-dear-jessie.webm (3.1M) -> ditto.mp3
(3.3M)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#60893

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-28 07:07 +0100
Message-ID<8636e81qkj.fsf@zoho.eu>
In reply to#60892
> Re: audio normalization, one can get mp3s with
> e.g. 'ffmpeg-normalize -c:a libmp3lame -ext mp3
> lame-music.webm', did it just now
> rollergirl-dear-jessie.webm (3.1M) -> ditto.mp3
> (3.3M)

But that's not the end of it. I picked
rollergirl-dear-jessie.webm because it sticks
out for having really _low_ audio. But the mp3
has even lower!

So I suppose I do this with every single file,
right? And then turn up the general volume?

And every time I add a new file,
I normalize it?

All these files are from YouTube BTW.
Maybe they don't have ffmpeg-normalize over
there :P

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#60896

FromPaul <nospam@needed.invalid>
Date2019-11-28 06:29 -0500
Message-ID<qrob3e$h9h$1@dont-email.me>
In reply to#60893
Emanuel Berg wrote:
>> Re: audio normalization, one can get mp3s with
>> e.g. 'ffmpeg-normalize -c:a libmp3lame -ext mp3
>> lame-music.webm', did it just now
>> rollergirl-dear-jessie.webm (3.1M) -> ditto.mp3
>> (3.3M)
> 
> But that's not the end of it. I picked
> rollergirl-dear-jessie.webm because it sticks
> out for having really _low_ audio. But the mp3
> has even lower!
> 
> So I suppose I do this with every single file,
> right? And then turn up the general volume?
> 
> And every time I add a new file,
> I normalize it?
> 
> All these files are from YouTube BTW.
> Maybe they don't have ffmpeg-normalize over
> there :P
> 

You can specify a level to normalize the file to.

You can normalize to 0dBm.

You can normalize to -15dBm.

In the latter case, you'll then need to turn up
the volume knob to be able to hear it.

If you normalize to +10dBm, the very loudest
part of the piece will clip and be distorted.
But you can test that and see.

*******

If you use "Loudness Normalization", that makes
the file even louder. It makes the quiet sections
louder than normal, and keeps the loudest part
from clipping. This is the processing technique
used to make TV commercials sound louder than
is allowed by law.

Since "Loudness Normalization" mutilates the file,
the output file should not be your only copy. You
want to keep the original file in such a case, as
your archival copy.

Whereas regular Normalize, doesn't do quite as much
damage. There could still be re-compression losses.
But the normalize function itself doesn't cause
too much math disturbance.

    Paul

[toc] | [prev] | [next] | [standalone]


#60930

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-29 06:58 +0100
Message-ID<86k17jw7f4.fsf@zoho.eu>
In reply to#60896
Paul wrote:

> You can specify a level to normalize the
> file to.
>
> You can normalize to 0dBm.

If dBm = dB/LUFS, then actually you can't :)
Because "[t]he range is -70.0 - -5.0."
(ffmpeg-normalize -h)

-15 is fine tho. Let's see how that works.
I wrote a small zsh wrapper.

get-mp3-normalized () {
    local -a files
    files=($@)

    local dBm=-15

    for f in $files; do
        ffmpeg-normalize -f -c:a libmp3lame -t $dBm -ext mp3 $f
        sleep $(( 5 * 60 )) # time for computer (RPi3) to cool down
    done
}

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#60931

FromEmanuel Berg <moasenwood@zoho.eu>
Date2019-11-29 07:05 +0100
Message-ID<86blsvw73f.fsf@zoho.eu>
In reply to#60930
>> You can specify a level to normalize the
>> file to. [...]
>
> [...] -15 is fine tho. Let's see how that
> works. I wrote a small zsh wrapper.

-15 db/LUFS works great, thanks a lot Paul! :)

And actually the file size went from 2.8M (the
original .webm from YouTube) to a 1.8M mp3!

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#61957

FromJohann Beretta <beretta@nun-ya-bizness.com>
Date2019-12-25 02:10 -0800
Message-ID<qtvcj8$4fb$1@dont-email.me>
In reply to#60931

[Multipart message — attachments visible in raw view] — view raw

On 11/28/19 10:05 PM, Emanuel Berg wrote:
<snip>
> 
> And actually the file size went from 2.8M (the
> original .webm from YouTube) to a 1.8M mp3!
> 

You're happy you lost a whole bunch of data?  Okay......

[toc] | [prev] | [next] | [standalone]


#60854

FromWilliam Unruh <unruh@invalid.ca>
Date2019-11-25 13:57 +0000
Message-ID<qrgmji$8aj$2@dont-email.me>
In reply to#60851
On 2019-11-25, Emanuel Berg <moasenwood@zoho.eu> wrote:
> Anyone knows some good software to normalize
> audio in a bunch of songs? m4a, webm and mp3
> files.

sox?

>
> I have normalize-audio which SOUNDS like it but
> it seems it "adjusts" the same thing every time
> I invoke it, also it doesn't support m4a or
> webm.
>
> TIA
>         

[toc] | [prev] | [standalone]


Back to top | Article view | alt.os.linux


csiph-web