HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - General => Topic started by: Kent Wang on 2003-07-06 00:29:29

Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-06 00:29:29
So, Doom9 is without a doubt the best place to talk about video compression techniques, but every film has an audio track that's just as important as the video stream. Doom9 folks know a lot about video but nowhere near quite as much about audio.

The most recommended gain/normalization technique there is using either BeSweet/Oggmachine or HeadAC3he's built-in normalization setting. I'm pretty sure this is an Azid setting and not the HA-preferred ReplayGain/WaveGain technique as it's displayed as Normalize to: 98% with an adjustable percentage setting.

Since I'm fairly certain that this is the case, my question then is: would you recommend that I stop using HeadAC3he (tool that passes Azid out (AC3->WAV) to the Vorbis encoder) and instead use Azid to get AC3->WAV, and then use the Vorbis encoder manually on the WAV to set ReplayGain?
Title: Replaygain For Movies
Post by: Digga on 2003-07-06 01:07:45
I've used GordianKnot up from 0.21 beta, so I got some experience in that sector.
I've encoded quite a few movies, and I used the settings recomended (that means, I didn't change anything, I let BeSweet made it's adjustments). I mainly do 1CD ripps (If it's not to bad quality) and always used mp3 with an abr of 128 or 160 (as you don't want the soundfile getting to big, so the movie still looks good).
I found the soundquality kinda good, I don't see any reason the work something out there. Of course, that is just my personal opinion.

My advise would be: first try to encode the traditional way via BeSweet, then use your own apps (WaveGain or whatnot...) and see if you hear a difference. Then make a desision afterwards.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-06 01:40:46
I've yet to come across any dvd that needed its audio track's volume changed. *shrug* (Replaygain sort of came about from the movie industry's practices, did it not? hehe)
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-06 01:50:30
Really? Most people find a lot of downloaded DivX files to have really quite audio tracks because they were improperly normalized or gained. Quite enough that this it's possible to max out the volume control in Windows and on your headphones (or shitty speakers) and be unsatisfactorily quite.

Even with Azid's normalize gain routines, it tends to be about half as loud as a properly gained FLAC. It's probably not a problem with software DVD players because their volume control system probably does amplification too. Of course this makes sense (to me at least, but I'm a n00b) because Azid's normalization (as with most applications that refer to normalization) finds the highest peak and applies gain based on that, whereas the ReplayGain routine calculates gain based on the average volume, and unlike music CD's a film will have a lot of quite scenes and dialog itself is not very loud.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-06 03:50:38
actually it's more than likely due to the decoder part of your ripping process that's lowering the volume as it's downmixing the 5.1 to stereo to avoid clipping. Why not just demux the ac3 stream and use the ac3 stream itself? I guess size might be an issue there, unless you're using 2 CDs.
Title: Replaygain For Movies
Post by: Bonzi on 2003-07-06 04:13:23
Actually, a lot of the doom9 people know quite a bit about audio, sure maybe not quite as much as some around here but there are some audio gurus over there.  As for the normalization, as someone said earlier it doesn't work the same way what replaygain does.  It is done differently.  My favourite tool for dvd audio processing is besweet, if you use something similar to this command line I am using for one of my movies:
"C:\Audio\BeSweet.exe" -core( -input "C:\DIEANOTHERDAY_DISC1\VIDEO_TS\list.ac3" -output "C:\DIEANOTHERDAY_DISC1\VIDEO_TS\list-New.ogg" -logfilea "C:\Video\Gordian Knot\BeSweet.log" ) -azid( -c normal -L -3db ) -ota( -hybridgain ) -ogg( -q 0.300 )
You should get proper normalization, hope this helps and BTW you can find besweet at doom9 of course,
EDIT: I should say that I am quite happy with the volume of this audio, sometimes when it is done incorrectly the audio will be way too soft and then you have to crank it up only to get blown right out of your seat by a huge gunfight or something, .  I don't have this problem when I do it this way.
Title: Replaygain For Movies
Post by: Pio2001 on 2003-07-06 05:25:04
According to this : http://replaygain.hydrogenaudio.org/statis...al_process.html (http://replaygain.hydrogenaudio.org/statistical_process.html)
replaygain does not calculate the average volume, but the volume ranked 95% in the list of all volumes from the quietest to the loudest.
It is a good value for music, but is it suited for movies, where soft dialogs can run during long times, and loud noise occur during only one second ?

Quote
Replaygain sort of came about from the movie industry's practices, did it not? hehe


Maybe, but I doubt that DVD soundtracks are mastered according to movie's standards.

Look at this mess :

(http://perso.numericable.fr/laguill2/pictures/gitsdynamics.png)

This is the same 50 seconds of the soundtrack of the same movie, in 5 different versions. I first wanted to us Headache to convert Ac3 to Wav, but I saw that normalisation couldn't be disabled, and that it also featured a dynamics compressor. So I just played the DVD and recorded the soundcard output instead.
Ghost in the Shell. Playback WinDVD2000 v2.4, stereo mode, SB64 soundcard, recorded with the other soundcard.

1 : Japanese DVD, Japanese soundtrack, AC3 2 channels
2 : Japanese DVD, English soundtrack, AC3 2 channels
3 : French DVD, French soundtrack, AC3 4 channels (DD 4.0)
4 : French DVD, English soundtrack AC3 6 channels (DD 5.1)
5 : French DVD, Japanese soundtrack, AC3 2 channels (DD 4.0) (former according to SmartRipper, later according to the sleeve)

In green : voice (normal talk)
In red : noises (automatic guns)
In blue : music (choir and percussions)

The most different ones are the first and the last, though both japanese 2 channels !
In the last version, the talking, in green is already louder than in the first. If you peak-normalize it, it will become even louder.
Title: Replaygain For Movies
Post by: Bonzi on 2003-07-06 05:35:30
Also, if people prefer the normalization of software dvd players such as WinDVD it is possible to use this to convert the ac3 or dts to wav through graphedit as these filters are directshow.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-06 05:39:05
well, I don't have 39 copies of the same movie from countries all over the world, but I have quite a few from Canada and every single time I watch a movie I put my amp's volume in the exact same position and it's always seemed to me to be pretty much the same loudness no matter what movie I watch.  Loud stuff sounds loud.  Dialog stuff sounds like dialog-level loudness.  No, I haven't ripped every single DVD I have and actually got some program to calculate and compare their volumes, and I'm sure they do differ somewhat.  But they all seem to me to be in enough of the same ballpark for it not to matter, since my playback volume on the amp is always the same position and I never have to turn it up or down because something's too loud or too quiet.  And no, the player isn't doing any dynamic compression. And Bonzi, when was the last time you heard a gun go off that was just as loud (or quiet, I should say) as your own speaking voice?  They're guns, they're supposed to be LOUD.
Title: Replaygain For Movies
Post by: Bonzi on 2003-07-06 05:55:48
Lol, ok I understand but still this is the way it is decoded in dvd players.  But, yes it is still quite loud,
Title: Replaygain For Movies
Post by: DarkAvenger on 2003-07-06 10:54:47
@PIO2001

If you want to disable normalisation in HAC3, simple untick 2pass.
Title: Replaygain For Movies
Post by: Pio2001 on 2003-07-06 16:29:45
Quote
it's always seemed to me to be pretty much the same loudness no matter what movie I watch.

This reminds me of the progressive scan stuff.
All movies with actors I have are properly encoded (in PAL). While 80 % of the anime I have are messed up (asynchronous or bad NTSC->PAL transcoding).

Maybe the same goes for the soundtrack. The one above is an anime. I don't remember about non-anime with a problem in the sound.
It seems that anime are looked as inferior stuff and not mastered properly, at least in Europe and USA.
Title: Replaygain For Movies
Post by: dTb on 2003-07-07 04:40:03
I use besweet using basically the same command line as Bonzi and the gain applied is always different, maybe due to the dynamic range compression I guess. If you don't use any drc then most dvd's are probably similar, maybe it's just me but the audio on dvds does seem to comform to set standards moreso than audio cds these days.

The dynamic range of dvds continually frustrates me however, I know what _Shorty is saying that a gunshot is so much louder than dialog but frankly I don't want it to be as loud as a real gunshot. I'm always having to adjust volume while watching movies which is really annoying. Personally I'm thankful dd has drc, I probably wouldn't watch dvds or dvd rips if it didn't exist.

Btw, besweet does tag ogg streams with an L_WING GAIN value which is read by some players like zoomplayer iirc.
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-07 04:58:16
Actually, it shouldn't be the player handles that but the filter. As far as I know, the only Ogg filter is the Ogg DirectShow hosted at Doom9, and it does indeed read ReplayGain tags (calculated by VorbisGain). So any player that has this filter installed will handle it properly. I tested with BSPlayer.

My current method is to use Dynamic Range Compression in BeSweet provided by WaveBooster (in BeSweet, it's the Boost tab) and not the DRC provided by Azid. Then I apply the VorbisGain tags. For the first time, I didn't need to touch the volume control when switching from listening to music to playing music.

But the unanswered question is with DRC, should one use peak normalization or ReplayGain for films? DSPguru (author of BeSweet) on Doom9 posted once that he didn't feel that ReplayGain was relevant for films but no thorough discussion took place. I posted a thread (http://forum.doom9.org/showthread.php?s=&threadid=57009) on Doom9.

I haven't tested my newly DRC'ed and ReplayGain'ed rips yet but I guess I'll post when I do. I'm really not sure how to do a double-blind test with something like a film.
Title: Replaygain For Movies
Post by: 2Bdecided on 2003-07-07 11:15:26
The dialogue normalisation in dolby digital is already doing the same thing that Replay Gain tries to do. It should be better. Of course, if you peak normalise then you'll destroy this, but I think I'd be tempted to peak normalise film sound tracks, and even apply automated DRC, for listening to the huge dynamic range of films over small PC/laptop speakers.


IIRC DD includes DRC info, which you can enable, disable, or even have at half effect - so (for example) you can have the explansions very loud, quite loud, or no louder than the speech.

Is this information (DRC and dail-norm) lost when people rip DVDs? It might be useful to figure out a way of maintaining it when the movie is transcoded. I'll bet DSP guru has thought of this, and has an answer as to why or why not.

Cheers,
David.
Title: Replaygain For Movies
Post by: M on 2003-07-07 11:40:49
Hmm... I remember when I first started doing DivX 5 encodes, I spent a while playing with the sound, trying to figure out why it was always so soft on playback.

  I first extracted the LPCM 2-channel soundtrack, and got a WaveGain estimation of the necessary volume change. Then I encoded using L.A.M.E. and manually adjusted the volume using MP3Gain (quicker than waiting for WaveGain to adjust a two-hour soundtrack, and it got the levels close enough for gov'ment work).

  At this point I tested my MP3 in Winamp. Sounded good, so I muxed it into the AVI with VirtualDub. Played the AVI in Winamp (using the VID4WA (http://rc4wa.narod.ru/) plugin) and, lo and behold, the volume was about half what it had been before. So I demuxed the MP3 from the AVI and played that version of the soundtrack in Winamp, and it was the proper volume again. 

    - M.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-07 19:27:04
well, I was going to say something long about directors and their desired effect on you and how dynamic range in sound can help achieve that, but I think those few words are enough. BTW, while you're compressing the dynamics out of the movie soundtrack, do you also run a blurring filter on the picture?
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-07 19:45:11
The AC3 tracks from the DVD actually already contain DRC info and BeSweet simply applies that when you convert from AC3 to anything else. Most DVD players already use the DRC information so failing to DRC your DivX rip would actually make it sound differently than what it would sound in a DVD player.

Since the DRC info is coming straight from the DVD, I'd argue that this is the more faithful home theatre translation of what the director and his (the only good female director is Julie Taymor) sound engineers have in mind.

@2Bdecided: I think the Dolby Digital dialogue normalization is actually different from the general DRC found in the AC3 tracks. My reasoning is that in Azid there are seperate options for handling these two.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-07 19:58:37
no, a dvd player would only use that information if you use that option. Assuming they use it in all cases isn't correct. My, and I'd guess all, player lets me change and disable any dynamic range stuff. The fact that the info is there doesn't mean it is always used, that's ridiculous.
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-07 20:10:16
I've never played with the option, but I do know that PowerDVD has it on by default. This also makes a lot of sense because I never have to constantly adjust my volumes on any standalone DVD player, whereas I did with lots of downloaded DivX files. I use the same speakers for both applications and they're not too crappy (Logitech Z-560).

I think DRC should be turned on because it truly is unbearable for most home theatre environments. Maybe you have a very high end one with superior acoustics that are more similar to a real theatre?
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-07 20:30:44
no, I just don't use computer speakers. I don't know how you could stand having dialog sound just as loud as a big gun fight or a huge car crash or a bunch of helicopters. Sounds bad like that, if you ask me. I have my volume knob set so that anyone talking in the movie is just as loud as if I were standing there with them and they were talking to me.  So it sounds like, surprise, they're there talking.  If you can manage to get someone in the same room with you, which probably is a pretty easy task to handle, then you could ask them to say a bunch of stuff and be aware of how loud they talk.  Very easy reference point. heh. Quiet stuff quiet, loud stuff loud, moderate stuff moderate.  Makes sense to me.  Makes movies much more enjoyable too.  But then, I'm not everyone, and not everyone likes things the way I do.
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-07 20:39:07
I do like my dialogue the same as real life, but though a gunshot should sound painful, I don't want to hear that. Nor my neighbors.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-07 21:58:30
yeah, I don't know of any movie that has something resembling the true difference between the two, but chances are the movie will still have the guns a lot louder than the dialog.  I meant more to illustrate that I prefer to hear the original dynamics without the dynamic compression features doing their thing.
Title: Replaygain For Movies
Post by: dTb on 2003-07-08 05:51:06
Thanks Kent Wang, I was unaware the oggds filter handled the gain tag. It's good that it's player independant.
There's nothing wrong with dynamic range but I think I would have to have a sound proof room and an expensive 5.1 setup to ever watch a dvd without any drc. My current setup is nothing special but it's far better than your average pc speakers.
Sometimes it just seems to me that spoken dialog is a little too low in the mix. I don't use anything above normal drc which still provides a fair amount of dymanic range, enough for me.
From what I can gather most dvd players have normal drc set as default, some don't include the option to enable/disable or adjust drc which is not so good.

Quote
BTW, while you're compressing the dynamics out of the movie soundtrack, do you also run a blurring filter on the picture?


A lot of the time, yes 

We still haven't answered you first question Kent Wang  . I guess I'm a little less questioning than some, if DSPGuru says do it this way I trust his opinion because he sure knows a lot more about it than I do.
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-08 06:00:52
Of course the beauty of ReplayGain is that it's easy to rip out without any loss. DRC, though, is not such a pretty story. However, DSPguru does endorse its use; he even wrote the preferred Dg compression mode.

BeSweet DRC is actually much better than the DeDynamic filter that most software DVD players. So your option comes down to 1) if you want DRC, run BeSweet and don't depend on the DVD player or 2) if you don't want DRC, figure out how to disable it in your player. Either way, players that use DeDynamic suck no matter if you want DRC or not.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-08 06:30:48
dTb, do you not have a volume knob?  There's something awfully wrong if you can't turn the volume up enough to make dialog sound as loud as people talking when you're dealing with a home theater/stereo. A laptop with headphones on a plane, I could see.  But not at home with even a $200 home theatre receiver and cheapo speakers.
Title: Replaygain For Movies
Post by: tangent on 2003-07-08 11:12:05
It's seems a simple enough solution turning the volume up on a low volume movie track.

Until you get an email alert or an instant message comes in.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-09 08:24:09
you're watching a movie, avoid interruptions.
Title: Replaygain For Movies
Post by: dTb on 2003-07-09 09:12:44
Maybe I haven't made myself clear, I don't have any trouble adjusting the volume, I just don't want to be doing it numerous times throughout a movie, that's all. Normal drc is usually good but I'm still adjusting the volume occasionally.

Like I've already said, the dynamic range on dvd's is no doubt great when you have the right setup, it just seems to me that on anything in the medium to low range it becomes a bit of a b**ch.

Btw, I playback movies through the 2.1 speakers on my samsung plano, granted not a great set up but pretty good imo. The progressive VGA input is excellent.
Title: Replaygain For Movies
Post by: smok3 on 2003-07-09 10:10:45
there are some 'interesting' docs about DD metadata found on dolby.com, basically it is about the dialog 'normalization' and drc and how all that applies on the 'stereo only' mode when needed....

http://www.dolby.com/metadata/pa.st.0102.MDGuide.pdf (http://www.dolby.com/metadata/pa.st.0102.MDGuide.pdf)

Quote
Is this information (DRC and dail-norm) lost when people rip DVDs?

it is lost when you make 2 channel wav of course, but azid decoder is aware of the metadata and drc stuff, from azid (v1.8 build 825) help:

Code: [Select]
c COMPR, --dcompr=COMPR
------------------------

Default: none

This option sets the overall dynamic compression in the decoder. This
value is applied to every output speaker.

The bitstream contains information of how much to amplify or attenuate
the sound to decrease the overall dynamic variations (loudness) in the
program contents. Different options exists to choose the wanted
dynamic reduction:


 o none     No dynamic compression. The program contents is unchanged.

 o normal   Normal dynamic compression. Normal in-store decoders use
     this as an hardcoded default.

 o light    Light dynamic compression. This is 50% (-6db) of the
     reduction/gain that normal dynamic compression would give.

 o heavy    Heavy dynamic compression. Intended for poor listening
     environment with much background noise.

 o inverse  Dynamic expansion. This is the inverse value of the light
     dynamic compression, i.e. it makes strong sounds stronger
            and weaker sounds weaker.
since most of the consumer standalone dvd players are using 'normal' afaik the deafult here isnt really a good one i guess.
Title: Replaygain For Movies
Post by: _Shorty on 2003-07-09 18:45:13
Quote
Maybe I haven't made myself clear, I don't have any trouble adjusting the volume, I just don't want to be doing it numerous times throughout a movie, that's all. Normal drc is usually good but I'm still adjusting the volume occasionally.

Like I've already said, the dynamic range on dvd's is no doubt great when you have the right setup, it just seems to me that on anything in the medium to low range it becomes a bit of a b**ch.

Btw, I playback movies through the 2.1 speakers on my samsung plano, granted not a great set up but pretty good imo. The progressive VGA input is excellent.

well, even a hunk o' crap $299Cdn dvd player / receiver combo that comes with crap speakers is quite capable of playing back a movie with dialog at dialog volumes and everything else at proper volumes except for the bass (cuz of the crap sub), so I'd suspect your speakers you're currently listening to would have to be pretty damn bad. The fact that they're built into the set is a very good indicator that they probably are. I don't have one of those all-in-one-box $299 systems, mine's before those kinds of systems' time, but my system is still pretty low-end and I never touch the volume control after I set it to my "this is where I play every single movie" volume setting when I'm first throwing the disc in and sitting down to watch.
Title: Replaygain For Movies
Post by: pusle on 2003-07-09 19:57:41
There is no need to mess with normalization and possible sound detoriation using other progs after azid. As the last poster pasted, azid has dynamic range options buildt in. If your comp can't handle full dynamic range ( none ), then use light or normal. Then  use the gain option to boost the max level so it just clips during the loudest passages.
Azid prints out the amout of overload/clipping in db. If it's less than 3dB on stuff like explosion and gun shots, it's just fine.
If you wanna be sure it sounds right, do it like me and write down the time stamps when overload occurs and listen to the wav with winamp. If it sounds ok, leave it. Many audio cd's comes with massive amounts of clipping straight from the studio. If it was something like a loud sopran at an opera that cause it to clip, it will usually NOT sound ok and you should use less gain. Like if you use -G 4, reduce it to -G 3 (linear multiplier factor).
As ac3 tracks has more than 16bits of dynamic range, you utilize the final 16 bits in the wav much better aswell. Using average loudness in some prog after azid to normalize will lead to excessive clipping and/or dynamic compression.
When you are happy with the loud and clear .wav , encode it with your favorite lossy coder, mux the mofo and pesto! :>
Title: Replaygain For Movies
Post by: dTb on 2003-07-10 04:00:19
Well it's hard for me to comment on the quality of the speakers in my tv because I don't have the experience some people around here do. So with nothing to really back it up all I'll say is I find them quite good, and there are other factors like background noise and neighbours to take into consideration when I'm watching dvd's or divx.
Thinking about all this I suddenly realised that in besweet I have the option to adjust the Center Downmix Level, so I think I'll experiment a little with that and see if I can't come to a satisfactory outcome for myself. Not sure why I didn't think of it long ago and maybe I can retain more dymanic range this way, eg. use light drc and raise the center channel volume in the downmix.

Thanks for the link smok3, I'll do some reading like I should have done long ago.
Title: Replaygain For Movies
Post by: Kent Wang on 2003-07-10 04:46:20
I got the Logitech Z-560. Now that you mention it, the range problem was much more apparent with the shitty-ass Cambridge set that I had a long time ago. So I do suppose that it's my speaker's fault, but then again very few people who I "share" my rips with have good systems. So now it's a case of making a rip that works better for the mainstream but is worse for the audiophile. Kind of like the compression in today's music CD's, eh?
Title: Replaygain For Movies
Post by: Kent Wang on 2003-10-06 06:23:51
Oh, yeah, I forgot to post about how my current technique (BeSweet DRC + VorbisGain only) worked out.

After ripping and encoding about 15 more films, I've found that ReplayGain is a terrific solution. I never have to adjust my volume between films, nor when switching from films to music.

The dynamic range after DRC is also quite good for my Z-560's. With the dialogue turned to a good volume, gunfire and explosions are just below intolerably loud.

When using my Sony V6 to listen though, I find that the range could tolerate less compression as explosions sound a bit weak. I think headphones are a good approximation of what a great neighborless HT speaker setup would be like.

In summary, I'm quite pleased with this technique and will continue to use it until I switch to AAC.