Kodi Community Forum

Full Version: Dynamic Range Compression (DRC) for Audio in Video, (kind of a ReplayGain for videos)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
this is something i have always wanted. the dynamic range in movies these days is huge. generally that is a good thing, but sometimes not. if you are trying to watch a movies with someone sleeping in the next room it's a pain.

set the volume so that you can understand the dialog in a quiet scene, and you get blasted when the music kicks in during an action scene.

being able to compress the dynamic range of movies would be a great addition to xbmc.
this might be easier to accomplish than i first thought. but it would have to happen at the "core" level. we use mplayer and mplayer use ac3filter (afaik). ac3filter supports drc (dynamic range compression)

:o

maybe a dev could take a look at it after 1.0?
fyi, the official feature requests for this can be found on sourceforge.net here => configurable dynamic range audio compression
(technical-note ps! dynamic range audio compression is not to be confused with "audio normalization" or "basic audio amplification").

@pike, problem is ac3filter is for directshow (xdk doesn't nativly support that), but ac3filter src is c++ so could maybe be ported(?)
ah, it's already been asked for. shiny!
some home cinema receivers has a nice night mode function.
i have no idea if it’s even possible in some way, but it would be a nice feature to have in xbmc if you (as i) don’t have it on your receiver.
it's a limiter that limits the volume so you don’t need to be so active with the tv remote between explosions and whispers...
first, it can only function with decoded audio, so you'd lose multichannel passthrough - would have to be decoded then re-encoded.

second, if you use analog out, then there is a parameter you can add to mplayer.conf to do this for ac3 sources - see the mplayer "man page" at http://www.mplayerhq.hu.

third, there is no current option for this - it's called "dynamic range compression" and can probably be done in hardware, though no such method has been implemented, primarily because no dev has been interested enough to do it.

a nice wee project for a new dev i would think (anyone listening?)

cheers,
jonathan
not much else to say really... i want dynamic range control functions for analogue dolby digital output
it's set to full drc at the moment.
so it is possible? (i wasn't sure if this was handled by mplayer exclusively and therefore not within realm of possibility for the xbmc developers)
it was always possible.

too many people complained about volume, so i set it on full permanently.

i guess it could be moved to mplayer.conf so it can be modified.
i don't even know if this is even plausible, but i think it would be really nice to have a compressor like "volume control" where you could input appropriate parameters to get, essentially, on the fly normalization of audio playback, with whatever drawbacks it might have. i've seen this kind of thing for mixing and music creation applications, such as mixmeister and propellerhead reason, being done in real-time. while xbmc is an incredibly feature rich (i, by chance, discovered that xbmc can play compressed video just the other week ^^) it does in my opinion lack certain audio capabilities when playing music from a more or less extensive mp3 archive. it's simply too cumbersome to have to use tools like mp3gain on any practical amount of music. and by "practical" i mean enough music to keep people pleased at a party ^^
i hope i won't get too badly burnt for this ^^
just some notes:

1. xbmc does have a compressor, but it's only enabled for videos.

2. it would be trivial to add the same thing for music, but i don't see the point really as most music is so compressed nowadays that additional compression is pointless. if anything, you actually want to normalize downwards.

3. xbmc supports replaygain. any decent encoder should be able to add replaygain data (must check and add to our lame and vorbis encoders if we don't do it in xbmc). xbmc also supports a default preamp level for non-replaygained tracks.

4. on the fly "normalisation" is not possible without knowing information about the loudest and quietest parts of the track in advanced. (aka have replaygained it). one possible suggestion for this is have xbmc store the min and max values once playback has finished on a track so that next time around they're replaygained. this may be added post 2.0 as it requires a database change.

i recommend just adding replaygain tags to your music as you encode. you can get masstaggers that'll do it for all your music collection in one go if that's what you're after (it'll take a while, but it's a one off hit).

cheers,
jonathan
(jmarshall @ may 03 2006,01:40 Wrote:2. it would be trivial to add the same thing for music, but i don't see the point really as most music is so compressed nowadays that additional compression is pointless. if anything, you actually want to normalize downwards.
i'm not certain if you misunderstood me or if i'm misunderstanding you, but file size isn't the issue.
at any rate, since i'm not an avid encoder myself (a bit lazy ^^) i don't really want to mess up crcs on my whole archive just to get decent playback, volume-wise.

(jmarshall @ may 03 2006,01:40 Wrote:4. on the fly "normalisation" is not possible without knowing information about the loudest and quietest parts of the track in advanced. (aka have replaygained it). one possible suggestion for this is have xbmc store the min and max values once playback has finished on a track so that next time around they're replaygained. this may be added post 2.0 as it requires a database change.
i know this, ie. using a compressor, isn't normalization per se. but the effect, when properly tweaked, would be more or less the same. mp3gain and other tools like it are very nice and does the job, were it not for the need to alter the contents of the files.
we are both talking about compression in the same sense - we are referring to the dynamic range (ie ratio of loudest sound to quietest sound) of the music.

most music nowadays is compressed way more than it should be (ie reduced dynamic range) in order to boost the overall volume of the music, so that it "jumps out" more when it's played on the radio (who tend compress the dynamic range even more).

and anything xbmc does to record the volume minima and maxima will not be recorded to the files themselves - rather it will be stored in the database file.

i reiterate though: nothing will happen in this regard until after 2.0. even after then, it's not exactly something that has a high priority, given that it's trivial to replaygain your files to begin with.
(jmarshall @ may 03 2006,11:38 Wrote:most music nowadays is compressed way more than it should be (ie reduced dynamic range) in order to boost the overall volume of the music, so that it "jumps out" more when it's played on the radio (who tend compress the dynamic range even more).
...
i reiterate though: nothing will happen in this regard until after 2.0. even after then, it's not exactly something that has a high priority, given that it's trivial to replaygain your files to begin with.
whether or not music is highly compressed nowadays still doesn't really address the "problem" at hand. because no matter how compressed it is the output will still vary from one album to the next.

as for post-2.0 features: why not allow the user to fiddle with the compressor (the one for video playback)? and enable it for audio? as far as i can tell i have no control whatsoever over the settings for the compressor...but might just be me being ignorant ^^