On Sun, 2006-08-27 at 21:55 +0100, `Zidane Tribal wrote:
> On Sun, 2006-08-27 at 19:03 +0100, `Zidane Tribal wrote:
> > hello all.
> > 
> > I'm trying to put together various dvd's with 5.1 ac3 audio tracks.
> > Can anyone point me in the right direction to some documentation on how
> > i would normalise the audio?
> > 
> > Basically, some of the video's are too loud, others too quiet.  I know
> > transcode itself will let me increase or decrease the volume by a
> > specific amount, but i would need to discover how much i need to inc/dec
> > each track and then re-transcode the audio adjusting each track by a
> > specific amount.  what would be really spiffy is something like
> > normalise in batch mode, which would allow me to have, say, 10 ac3
> > tracks, scan them all and normalise them all to 12db.
> > 
> > does such a thing exist?   if not, can anyone point me towards some
> > documentation on how to convert ac3 5.1 surround into different channels
> > so i can normalise them as wavs, then re-mux and transcode them back
> > into an ac3?
> > 
> > any help would be much appreciated.
> > 
> > `Zidane.
> > 
> > 
> 
> 
> ok, now i know i'm replying to my own mail, but hopefully this should
> keep it in the same thread ;)
> 
> after much man-page reading and fiddling around, it would seem i can use
> mplayer to extract each individual audio track in turn, as follows:
> 
> mplayer -channels 6 -af channels=1:1:1:1 ./x-men-1.vob
> mplayer -channels 6 -af channels=1:1:2:1 ./x-men-1.vob
> mplayer -channels 6 -af channels=1:1:3:1 ./x-men-1.vob
> (etc...  for all six channels)
> 
> where:- 
> 
> mplayer -channels 6
> -af
> channels=no-of-output-channels:no-of-routes:map-channel-X:to-channel-X
> 
> now i can get each channel out on its own, it shouldn't be too much
> trouble to fiddle around with transcoding it to, say, wav, and using
> something to normalise it.
> 
> however, this leads me to another curious quandry.   after digging
> around to try to find out which channel number represented which
> 'speaker', i came accross the ac3 spec here
> http://www.atsc.org/standards/a_52b.pdf which implies there can be 8
> different track layouts (table 5.8 is the part that defines them).   so,
> the question now becomes, does anyone know of a tool that can give me
> the 'acmod' feild, so that i know which track is which?  preferably
> something cli-based, as i want to incorperate this into a shell script.
> 
> many thanks in advance if anyone can point me in the direction of
> something that could tell me which trach is which 'speaker'.
> 
> `Zidane.
> 

ok, for those who are following the only thread where one person answers
his own questions, you'll be glad to know the men in the white coats are
on the way ;)

on a more on-topic note, in a blinding flash of inspiration, i realised
i'm over-thinking the problem :)  rather than having to identify the
tracks, i can pull them out, normalise them, then put them back in the
right order.   i dont need to know what each track is, just make sure i
maintain the order of the tracks.

i noticed someone asked on the wiki whether a procedure exists to
normalise 6 channel ac3 audio.   there is now :)   i'll list it here and
put it on the wiki just as soon as i make sure all the levels are
normalised ok and find the email that gives me the editing instructions.

to normalise 6 channel ac3 audio tracks....

(note:  a couple of parts of this are shamelessly copy/paste'ed from the
wiki and the http://mightylegends.zapto.org/ pages)


Find out if the original .avi/.mpg file already contains a 5.1 AC3 audio
track: 

 mplayer -vo dummy -identify movie.avi 2> /dev/null | grep 5.1

A positive output would look something like: 

 AC3: 5.1 (3f+2r+lfe)  48000 Hz  384.0 kbit/s

If it does, then extract it using 'tcextract'

 tcextract -d2 -i movie.avi -a0 -x ac3 | tcextract -d2 -x ac3 -t raw > movie.ac3


once this has been extracted, use mencoder to extract each individual track 
into a pcm wav.

mplayer -channels 6 -af channels=1:1:0:0 -ao
pcm:waveheader:file=track0.wav -vc null -vo null ../movie.ac3
mplayer -channels 6 -af channels=1:1:1:0 -ao
pcm:waveheader:file=track1.wav -vc null -vo null ../movie.ac3
mplayer -channels 6 -af channels=1:1:2:0 -ao
pcm:waveheader:file=track2.wav -vc null -vo null ../movie.ac3
mplayer -channels 6 -af channels=1:1:3:0 -ao
pcm:waveheader:file=track3.wav -vc null -vo null ../movie.ac3
mplayer -channels 6 -af channels=1:1:4:0 -ao
pcm:waveheader:file=track4.wav -vc null -vo null ../movie.ac3
mplayer -channels 6 -af channels=1:1:5:0 -ao
pcm:waveheader:file=track5.wav -vc null -vo null ../movie.ac3

this should leave you with 6 files, track 0 through 5.

now, time for some normalisation (yay!   linux can make me normal!  no
more talking to myself on mailing lists!)

normalise-audio -b *.wav

we use batch mode (-b) on the normalisation process for a reason.
namely, the 5.1 soundtracks are balanced, you dont want all of them at
exactly the same volume.  batch mode reads the average levels of all the
files, then calculates *one* increase, and applies the same increase to
all files, rather than normalising each file individually.

once we are normal, we bunch all the tracks back up into a 6 channel ac3
file with multimux and ffmpeg.

multimux track0.wav track1.wav track2.wav track3.wav track4.wav
track5.wav -o final.wav

ffmpeg -i final.wav -ab 448 -ar 48000 -ac 6 final.ac3


and there we have our shiny normalised ac3 soundtrack, with all the
channels increased or decreased in volume :)  its a little kludgey, bit
it appears to work.   time for me to go get some sleep and let transcode
do its thing.

`Zidane
(sleep deprived, sanity torn and tattered).














Reply via email to