Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Replay-gain for movies. (Read 11983 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Replay-gain for movies.

Is it at all possible to apply some kind of replay-gain to videos on my PC? Sometimes when I watch a film late at night, I am annoyed by sometimes not being able to hear any conversation, or being startled by really loud parts in action scenes.

Is this only possible for certain video formats, and for certain Media players? I currently use WMP9 or media player classic to watch my films.

Thanks
-mac

Replay-gain for movies.

Reply #1
Is it at all possible to apply some kind of replay-gain to videos on my PC? Sometimes when I watch a film late at night, I am annoyed by sometimes not being able to hear any conversation, or being startled by really loud parts in action scenes.

Is this only possible for certain video formats, and for certain Media players? I currently use WMP9 or media player classic to watch my films.

Thanks
-mac


AACGain will work on videos in Qucktime (.mp4) format.

Dave

Replay-gain for movies.

Reply #2
Since you want to edit the audio, the video has got nothing to do with it.
There are two ways, one is lossless, the other is lossy. The lossless way can be done only if you have a mp3, aac or lossless format stream. Other audio formats will have to be done in a lossy way.

Firstly, you will have to extract the audio (demux). This can be done with a varying amount of tools, depending on the container. Better you tell us what formats you want to deal with.

Second, the extracted audio file must be replaygained with foobar2000.
-or-
The lossless way for mp3 or aac: Run mp3gain or aacgain. You can skip the third step.

Third, convert the replaygained file with foobar and tell it to recognize the replaygain, so the adjustment is encoded in the file.

Fourth, mux it with the video stream. Here you have again various choices of tools for the container format. If you only have AVIs VirtualDub(Mod) is all you need.

Replay-gain for movies.

Reply #3
So the video file and the audio file are two separate things, and I need to 'extract' the audio file from within the video file (.avi for example), add replay-gain separately, and then re-combine it with the video file?

Is there no way that I can simply apply replay-gain to the video via some quick-access option within the media player? - Thing is I only want reply-gain enabled when I watch a movie late at night, but the rest of the time I would prefer to have the intended audio levels enabled for a better effect. It would be ideal if I could just quickly change the setting whenever I want to re-watch a film (which I often do with decent films), instead of having to go through that process each time. I guess this isn't possible then?


In the case that there is no alternative, then I would prefer to work with aac for higher quality (this might involve actually converting the audio format first?).

Also, I already use foobar2000 for my music, so can I do the lossless method within foobar2000? i.e. apply 'aacgain':
Quote
The lossless way for mp3 or aac: Run mp3gain or aacgain. You can skip the third step.


Also I have various video formats, some avi's, some divx, some mp4, but since it might be easier to work with a single format, I could probably convert all the files to a single format. What is the 'best' (highest quality) format, and what program would I need to convert them into that? (disk space is not a major issue, as I can burn them to DVD+R at a later date I suppose, though this might add further complications (?)  )

Thanks alot
-mac

Replay-gain for movies.

Reply #4
Quote
So the video file and the audio file are two separate things, and I need to 'extract' the audio file from within the video file (.avi for example)

Not exactly, the AVI "holds" the video and audio stream. It is a "container" for them. If you want to playback a file, a splitter splits it into video and audio and then the corresponding codecs jump in. For more info look on to wikipedia:
http://en.wikipedia.org/wiki/Container_format_(digital)
http://en.wikipedia.org/wiki/Comparison_of_container_formats

Quote
I would prefer to have the intended audio levels enabled for a better effect.

ReplayGain changes the overall volume of a file, so the dynamics are left intact. What you mean is normalize.

Quote
Is there no way that I can simply apply replay-gain to the video via some quick-access option within the media player?

Sorry, I don't know of such an option. Maybe someone other can help you better here.

Quote
Also, I already use foobar2000 for my music, so can I do the lossless method within foobar2000? i.e. apply 'aacgain'

If the source is aac then you can use the mp3gain-gui and exchange the mp3gain.exe with aacgain.exe. Then you can load the aac-file via the gui and let it work normally.

Quote
Also I have various video formats, some avi's, some divx, some mp4, but since it might be easier to work with a single format, I could probably convert all the files to a single format. What is the 'best' (highest quality) format, and what program would I need to convert them into that? (disk space is not a major issue, as I can burn them to DVD+R at a later date I suppose, though this might add further complications

Well, the "best" format would be Matroska, as you can see in this comparison, but the video isn't going to look better or worse. The video and audio will only switch his "home". The overall file will be a bit smaller though, because the header isn't as big as the one from AVI. Only drawback is that you can't playback Matroska on standalone players. But if you only look on PC then it's all good.
You can convert from various formats into Matroska with MKVtoolnix. After that you can extract the audio with MKVExtractGUI and edit it like I told you.

For playback I recommend the CCCP, as it's the recommended codec pack from Matroska.

Hope this helps

An addition:

If your .divx contain advanced features like dvd menus and subtitles it would be best to let the files the way they are, because it's an proprietary format. I don't know if mkvmerge gui can even read those files, since I don't have one of those. Sorry if I'm mistaken...

Replay-gain for movies.

Reply #5
Thank you! Thats some really helpful advice.  I'm gonna have to have a good look through all of those sources when I get a minute.

Quote
ReplayGain changes the overall volume of a file, so the dynamics are left intact. What you mean is normalize.


Yes normalize is what I actually want then, not replay gain.

Thanks,
-mac

Replay-gain for movies.

Reply #6
Thank you! Thats some really helpful advice.  I'm gonna have to have a good look through all of those sources when I get a minute.

Quote
ReplayGain changes the overall volume of a file, so the dynamics are left intact. What you mean is normalize.


Yes normalize is what I actually want then, not replay gain.

Thanks,
-mac

no, what you want is Dynamic Range Control.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Replay-gain for movies.

Reply #7
Something similar to ReplayGain (in the form of dialnorm), and selectable dynamic range compression (in the form of DRC, "midnight mode", "RF mod mode" or whatever it's called on your software / receiver) are already built in to Dolby AC-3. If the source is a DVD, I wouldn't fiddle.

If the source is something not AC-3, DC is more useful than ReplayGain for inaudible speech.

Cheers,
David.

Replay-gain for movies.

Reply #8
What I do for movies is:

1. demux the audio track using AVI-Mux GUI
2. use foobar2000 to resample to half (ie: 24kHz or 22.05kHz), convert to stereo (if needed), reduce dynamic range (using vlevel plugin), and convert to mp3 (lame -V9) or ogg (-q-1) depending on the playback device
3. remux the new audio track with AVI-Mux GUI, preferably in a Matroska container (smaller filesize).

Depending on your playback device, you might want to skip the resample, downmixing to stereo, and use a higher bitrate.

 

Replay-gain for movies.

Reply #9
Is it at all possible to apply some kind of replay-gain to videos on my PC? Sometimes when I watch a film late at night, I am annoyed by sometimes not being able to hear any conversation, or being startled by really loud parts in action scenes.

Is this only possible for certain video formats, and for certain Media players? I currently use WMP9 or media player classic to watch my films.

Thanks
-mac


If I understand you correctly, all you want is a "midnight" type setting so for when you are listening late at night with the volume turned down.  I do the same thing and a very simple method is to use the "normalize" setting in MPC (MPC = media player classic - do a quick search for it or the k-lite full codec pack (rec.) which includes MPC).  With MPC all you do is start your movie, left click anywhere on the movie to pause, right click, select audio-> options and you'll see a box for normalize.  Check the box, click apply, okay, and then left click on the movie to start play again.  Repeat the process to take normalize off when you can listen at higher volumes.

I know that everyone here hates normalize (with good reason), but at least with this method it's simple, very fast, easily reversed, and makes no changes to the original files.  It won't sound as good as the original or with replay gain, but it should sound fine for your situation.

Replay-gain for movies.

Reply #10
ok, i guess word 'normalize' is sometimes used instead Dynamic Range Control...
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Replay-gain for movies.

Reply #11
I would like to apply replaygain for my movies too, but I noticed an obvious problem: Movies are too dynamic!! The movie I tried on get a replaygain value of something like +8 (with full peak 1.0)

So if I transcode I will not be able to retain the dynamic present in the audio stream if I hardcode the replaygain. I will most likely use AAC for transcoding, so AACgain might be an option - But then what will happen with the dynamic?

I also have some concerns with DRC. Are DRC in AC3 files something hardcoded, or does it work much the same way as vlevel for foobar2000, just increasing the volume in quiet passages during playback? I will probably use some kind of DRC for the movies at the moment as I live in an apartment, but still I'd like to retain the dynamic, if I someday need the movies for other purposes.

The reason I like to use replaygain for movies, is that I use the same media center for music, and everytime I has watched a movie, my amp is turned up to insane levels.

I'm using the CCCP - does it offer something I could possebly use?
Can't wait for a HD-AAC encoder :P

Replay-gain for movies.

Reply #12
You can use ffdshow with Media Player Classic to achieve dynamic range compression on the fly. There's no need to permanently modify your original files to do it.

Quick Guide

Install ffdshow

Run Media Player Classic and select "View /Options...". Click on "External Filters /Add Filter..." and browse for the "ffdshow Audio Processor". Double-click on it then set it to "Prefer".

You should now see an "ffdshow raw audio decoder" icon in your taskbar when playing a movie. Right-click the icon and select "ffdshow Audio Processor". A setup window should now open and you can customise many settings in here. These are my preferred settings for night-time listening...

Volume: Decibels scale= tick, Master Volume= -9dB, Normalize= tick, Reset on seek= tick, max. amplification= 12dB.

Crystality: Bandwidth extender= 25, Extender's highpass filter= 1, Harmonic Booster= 25, all other values= 0.

There's plenty of other stuff to play around with in there, but those two tabs alone should increase intelligibility at low volumes and squash the dynamic range without killing it altogether. Don't forget to save a profile once you're happy.

Cheers, Slipstreem. 

Replay-gain for movies.

Reply #13
That's nice, I will definately play with it later

But it doesn't really solve the ReplayGain question... One approach could be to perform RG over a range of movies and find the lowest coefficient and use that as a reference value instead of 89dB when applying aacgain, and then just compensate for it in the decoder?
Can't wait for a HD-AAC encoder :P

Replay-gain for movies.

Reply #14
Well... it does and it doesn't. LOL

ReplayGain isn't going to help to reduce the dynamics within each movie, it's only going to level the average volume across movies which already seems fairly constant with the commercial DVD collection I have here. This approach is entirely non-destructive and will level out the volume throughout all movies and across all movies. The "contrast" of the dynamics left behind is entirely adjustable by the end-user at any time.

Whether it's right for you or not is for you to decide, but it's definitely worth having a play with if your primary playback machine happens to be a PC.

Cheers, Slipstreem. 

Replay-gain for movies.

Reply #15
Heh, of course I know what RG does and doesn't

So it sounds like your approach is much like vlevel? I already use a similar feature in mplayerc - I think they call it volume normalizing, and it kinda works the way it should, but I think it's a little too heavy on the volume differences, and also it amplifies dialogue too much sometimes.
Can't wait for a HD-AAC encoder :P

Replay-gain for movies.

Reply #16
I knew you knew really.

In that case, you could try my approach and just use a lower figure than 12dB for the amplification to achieve less compression. The global gain value of -9dB will probably need raising 1dB for every 1dB you drop the amplification by to keep the same average volume level. I only set it to -9dB in the first instance to help avoid clipping on rapidly rising volumes that ramp up faster than the compressor can respond with a gain reduction.

Cheers, Slipstreem.