Back Forum Reply New

Audio normalize recommendations?

I created a number of DVD compatible .mpeg files (out of various avi files) and I plan to put them all together on one DVD. The audio on these files are at different levels.
What is a good quick/easy to use package to normalize the audio on the different movie clips to the same volume level? (I'm not adverse to using the command line).  

Should I have performed the normalize while the files were still in avi format (prior to converting to mpeg), or does it matter?

I don't think you can do anything now with the .mpeg files. If you still have the originals you could extract the audio to .wav files, use wavegain (projects/wavegain/) preferably instead of normalize and then encode to .mpeg


Originally Posted by echoI don't think you can do anything now with the .mpeg files. If you still have the originals you could extract the audio to .wav files, use wavegain (projects/wavegain/) preferably instead of normalize and then encode to .mpeg

Thanks.  I have the originals, but they are in a non-editted form.  Looks like I'll have to start over and redit.  

I downloaded wavegain, and it took me a while to figure out how to install it.  Not a typical install.   I haven't tried it out yet.


Originally Posted by echoI don't think you can do anything now with the .mpeg files. If you still have the originals you could extract the audio to .wav files, use wavegain (projects/wavegain/) preferably instead of normalize and then encode to .mpeg

Following your recommendation (for wavgain) I took four mpg files created by tovid, and extracted the audio (which was in an ac3 format) as follows:
mplayer input1.mpg -ao pcm:file=temp1.wav
mplayer input2.mpg -ao pcm:file=temp2.wav
etc ...

I did this for 4 different music video's, which had significantly different volume levels.  I then ran wavegain against these wav files, to normalize the audio level:

wavegain --radio --apply *.wav
This rewrote each .wav file, adjusting the audio levels.

I then listened to the wav files, and the audio volume levels from file to file were much more balanced than the originals.

I individually converted each of them back to ac3 using a tovid script:
ffmpeg -i temp1.wav -ab 224 -ar 48000 -ac 2 -acodec ac3 -y quot;temp1.ac3quot;
ffmpeg -i temp2.wav -ab 224 -ar 48000 -ac 2 -acodec ac3 -y quot;temp2.ac3quot;
etc ...

I then individually stripped the audio out of each of the original mpg (creating an m2v):
tcextract -i input1.mpg -t yuv4mpeg -x mpeg2 gt; temp1.m2v
tcextract -i input2.mpg -t yuv4mpeg -x mpeg2 gt; temp2.m2v
etc ...

And finally individually recombined each of them into a new mpeg:
mplex -f 8 -o final1.mpg temp1.m2v temp1.ac3
mplex -f 8 -o final2.mpg temp2.m2v temp2.ac3
etc ...

idvid assess the quot;final1.mpgquot;, quot;final2.mpgquot;, etc ... as all being dvd compliant. I haven't yet tried to burn them to dvd, but this does seem to work for normalizing the audio.   Hopefully I haven't lost too much audio quality in the process.

I can now call these revised files with dvdauthor -x myxmlfile.xml (to create my compilation dvd):

But this normalizing the volume level is a lot of work!  And this may not be the most efficient way to do this    If only there was a way to automate it.

Edit: (11-June-06) - Fixed typo in ffmpeg command (for converting from .wav to .ac3)

I discovered another package that will normalize audio volume across multiple files. I haven't tried to compile and installed it yet:

aacgain
aacgain/
[while I believe it is primarily built for windows, there is a link to a unix tarball at the bottom of the page].

Reading the wiki (linked below) on replay gain makes me think that I need to do more of a test to be certain wavegain will do what I want.
wiki/Replay_Gain

I stopped short of actually burning a dvd with my new mpeg files, and I now think for my test to be complete, I need to actually create a DVD, and see if the audio volume normalization worked.


Originally Posted by oldcpuI discovered another package that will normalize audio volume across multiple files. I haven't tried to compile and installed it yet:

aacgain
aacgain/

I tried ACCGAIN /g 20 on an acc file demux'ed from a mp4, and then remux it to a mp4, play with Quicktime, and the sound level remains the same...  

Also, after gained, foobar complains:
Playback Error:
Decoding failure at 0:00.192 (Unsupported format or corrupted file):
quot;C:\ffmpeg\output.aacquot;

Originally Posted by fanbanloI tried ACCGAIN /g 20 on an acc file demux'ed from a mp4, and then remux it to a mp4, play with Quicktime, and the sound level remains the same...

I didn't have any luck with ACCGAIN either.  But I am pretty happy with WAVEGAIN.

I discovered mp3gain can be used to normalize mp3 files.

penguin/man/1/mp3gain.html

But what I am looking for now is a program that will normalize the audio across multiple .avi files, without me having to pull out the audio to either .mp3 or .wav format, normalize, and then have to rejoin the normalized audio with the respective video.

mencoder is your friend !Code:
mencoder.exe -ovc copy -af volnorm=1 -oac mp3lame -lameopts cbr:br=128 input.avi -o output.avi
BHH


Originally Posted by buzzqwmencoder is your friend !
Code:
mencoder.exe -ovc copy -af volnorm=1 -oac mp3lame -lameopts cbr:br=128 input.avi -o output.aviThanks, I'll give it a try and report back how it worked!
¥
Back Forum Reply New