1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AVI Normalize & MP3Gain programming?!

Discussion in 'Audio' started by KiNoKe, Apr 10, 2004.

  1. KiNoKe

    KiNoKe Member

    Joined:
    Apr 10, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    AVI Normalize at http://www.vidomi.com/download.php?op=geninfo&did=19 is 3 utilities which extracts the mp3 from avi file(s) and then normalizes the mp3 in MP3Gain at http://mp3gain.sourceforge.net/and last combine avi with the new mp3-file using NanDub. It's all done by executing a bat-file.

    Now here is the problem! MP3Gain(Dos-version, command-line back end) can not Normalize to a specified level(dB of max volume) so it is automated and can still become clip in mp3-audio. I've tried all dos-commandos available in mp3gain.exe but no success.
    MP3Gain has a GUI called MP3GainGUI.exe, it normalizes mp3 at a desired dB, so it has more functions.

    Here is my question:

    Does anyone know how to edit the bat-file so the MP3Gain GUI handles the mp3 instead of MP3Gain DOS?

    I've tried to replace mp3gain.exe with MP3GainGUI.exe in bat-file, and when I execute the bat-file it opens the mp3-file in MP3Gain GUI but doesn't normalize it.

    The source-code for MP3Gain GUI is at the author's website.

    Anyone with programming knowledge(Visual Basic and C++) and script macro commands (bat-file)!

    Please Help?!
     
  2. tigre

    tigre Moderator Staff Member

    Joined:
    Feb 18, 2003
    Messages:
    789
    Likes Received:
    0
    Trophy Points:
    26
    I'm not sure if I understand correctly what you want...

    You want to do kind of peak normalization with mp3gain?, i.e. you want it as loud as possible without clipping - correct?

    This can be done with mp3gain.exe /r /k infile.mp3
     
  3. KiNoKe

    KiNoKe Member

    Joined:
    Apr 10, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    I want to be able to adjust the volume to a desired dB, not max dB without clipping i.e. I want to make the volume 91 dB like in the GUI. Or 70% of max volume.
     
  4. tigre

    tigre Moderator Staff Member

    Joined:
    Feb 18, 2003
    Messages:
    789
    Likes Received:
    0
    Trophy Points:
    26
    mp3gain.exe /r /d 2.0 infile.mp3
    Result: The perceived loudness will be 91dB = 89dB (default) + 2dB (-> /d 2.0)

    If you do this with movie audio, there are quite big chances that you still get clipping in a few places because movie audio often has a big dynamic range (-> explosions etc.)

    What max volume are you referring to? The highest peak of the waveform or perceived volume as measured by mp3gain? I case it's the former: This has to be done in 2 steps:

    mp3gain.exe /r /d 20 /k infile.mp3
    mp3gain.exe /g -2 infile.mp3

    The 1st step will cause normalization to the highest possible volume without clipping (=> highest peak is between 0 and -1.5dBFS), the /d 20 is to avoid too low volume with loud (overcompressed) tracks, shouldn't be necessary for movies.
    The 2nd step will decrease volume by 3.0dB, so the highest peak will be between 70% (= 0 - 3dBFS) and 60% (-1.5 - 3dBFS.

    FYI: mp3gain.exe command line options:
    I think I've understood what you whant to do, but I'm not sure why. If you want to get rid of clipping, you can do what I've suggested in my previous post. Why would you want to lower volume even more? This will decrease signal/noise ratio on playback without any benefit I'm aware of.
     
  5. KiNoKe

    KiNoKe Member

    Joined:
    Apr 10, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    Thank you VERY much! It worked.

    I want that degree of level 'cause I use a DivX DVD-player Called KiSS DP-450 to watch the avis on my TV, and 70% of the highest peak of the waveform is a good high and not too low volume on my player.

    By the way! Do you know why mp3gain uses 89 dB for suggested max volume(without clipping)? When Sound Forge say 0 dB(or 100%) is the highest volume. It's totally different info on how you measure volume in sound-files.

    I'm totally confused with mp3gain!
     
  6. tigre

    tigre Moderator Staff Member

    Joined:
    Feb 18, 2003
    Messages:
    789
    Likes Received:
    0
    Trophy Points:
    26
    These dB values can't be compared.

    I don't know Soundforge, but there are two possibilities what "0dB" can mean:

    1.:
    "0dB" = 100% means that the biggest peak of the waveform is at the max possible amplitude, i.e. 32767 (or -32768) for 16bit resolution. -3dB means 10^(-3/20) = 0.71 = 71% means the peak value is 23197.

    2.:
    This is what CoolEdit's "Waveform statistics" show: The RMS power ("Root mean squared ampliutde"); a given window is analysed and compared to a reference (either full scale square wave or full scale sine wave defined as 0dB).

    mp3Gain (or replaygain for other formats in PC environment) tries to simulate the ear to estimate the perceived volume, i.e. it performs a frequency analysis and multiplies the values with an inverse function of the human absolut treshold of hearing (ATH), i.e. a sine tone at ~ 3000 Hz will raise the estimated value much more then a sine tone at 50 or 15000 Hz with the same amplitude. By adding the values across the spectrum and adding the results of all analysed time windows, the resulting dB value is calculated. I can't tell how 100dB, which seems the upper limit is calculated, it could be defined as what the algorithm calculates for a full scale square wave or white noise with equal distribution. If you want to know more about this http://replaygain.org/ is a good starting point.


    Replaygain/Mp3gain is designed (mainly for music) to make tracks (or CDs) sound equally loud, so fiddeling with the volume button isn't necessary e.g. when playing back a mixed playlist. The problem about what dB value to choose as goal is this: Tracks with big dynamic range (mainly classical music), especially when containing lots of low volume parts and only few loud ones, have a low (with replaygain method) measured overall volume. If replaygain/mp3gain is applied, the whole track is amplified, the result can be clipping. On the other hand, the volume of overcompressed recent mainstream music will be lowered by several dB (up to 10 and more) when applying replaygain/mp3gain, resulting in too low volume for many cheap portables.

    89dB was chosen as good compromise. For people who listen to classic, jazz and similar genres on decent equipment, lower values like 83dB are recommended (if using replaygain/mp3gain is necessary at all), for ppl who listen to mainstream music on portables with weak output, higher values like ~ 92-95dB might be better.
     
  7. KiNoKe

    KiNoKe Member

    Joined:
    Apr 10, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    Thanks for your answer, I really appreciate it.
     

Share This Page