VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Hello,

    mediainfo shows this dynrng : 5.88 dB in an AC-3 file.

    Is this only a flag and can be removed without reencoding the audiofile?

    Another ac-3 shows this compr : -0.28 dB
    Is this a dynamic compression too and needs to be removed for the "right" dynamic?

    Thanks
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    This article implies that when dynrng is used (in Aften) to create an ac3 file,
    the data is compressed and the dynamic range is reduced

    https://aftenblog.blogspot.com/2006/10/dynamic-range-compression.html
    Quote Quote  
  3. As far as I'm aware dynrng, or dynamic range compression, is achieved via data in each frame of the audio stream, so the audio itself isn't compressed, but the DRC data can't be removed.
    If I remember correctly the Dolby spec says that any DRC data must be applied by a decoder that lacks the ability to configure whether dynrng is used or not, but decoders are allowed to give the user an option to disable the compression. Codecs such as ffmpeg ignore it by default (edit: incorrect for ffmpeg, see post #5) but I've no idea what hardware players are likely to do.

    Another ac-3 shows this compr : -0.28 dB
    If you drill down into an AC3 file using MediaInfo's debug mode you'll probably see this sort of thing when dynrng data is present.

    Code:
    dialnorm_Average                         : -26
    dialnorm_Average                         : -26 dB
    dialnorm_Minimum                         : -26
    dialnorm_Minimum                         : -26 dB
    dialnorm_Maximum                         : -26
    dialnorm_Maximum                         : -26 dB
    dialnorm_Count                           : 869
    compr_Average                            : 3.56
    compr_Average                            : 3.56 dB
    compr_Minimum                            : 0.53
    compr_Minimum                            : 0.53 dB
    compr_Maximum                            : 5.16
    compr_Maximum                            : 5.16 dB
    compr_Count                              : 869
    dynrng_Average                           : 3.57
    dynrng_Average                           : 3.57 dB
    dynrng_Minimum                           : 0.27
    dynrng_Minimum                           : 0.27 dB
    dynrng_Maximum                           : 5.16
    dynrng_Maximum                           : 5.16 dB
    dynrng_Count                             : 869
    dialnorm is another issue. It's used to adjust the volume of the entire audio by a set amount in order to ensure dialogue is always the same level. The default level is -31dB, so for the example above, -26 dB means the decoder is supposed to reduce the over-all volume by 5dB. I think most software decoders ignore it by default these days. If you extract AC3 from a file with eac3to it changes the value to -31dB by default so the volume won't be adjusted. It's not really destructive like DRC though, as it only adjusts the entire volume by a set amount, but it's why AC3 audio can seem a bit quiet compared to other formats when dialnorm is applied.
    Last edited by hello_hello; 6th Sep 2025 at 08:52.
    Quote Quote  
  4. but the DRC data can't be removed.
    That's sad.

    My workaround at the time is using UsEac3To.

    UsEac3To 1.3.4 removes the DRC, but only with reencoding, not just adjust some metadata.(But that is what I'm looking for to avoid any reencoding)

    Codecs such as ffmpeg ignore it by default but I've no idea what hardware players are likely to do.
    I can test only with PC und Stereo Audiosetup for reasons at the moment...
    So my results are, that VLC, Windows Media Player and the "newer" Win11 Videoplayer DOES apply the Dynamic Range Compression by default!
    Only MPC-HC (Media Player Classic Home Cinema) plays AC3 files WITHOUT the DRC.

    If you drill down into an AC3 file using MediaInfo's debug mode you'll probably see this sort of thing when dynrng data is present
    Nice, I don't know abou the debug mode.

    dialnorm is another issue. ... It's not really destructive like DRC though, as it only adjusts the entire volume by a set amount.
    Yes, my opinion is, that this can be ignored...

    NOW:
    Try this by yourself.
    I've uploaded 3 files:
    - sample of the dynrng : 5.88 dB AC3 file.
    - wav encoded with clever FFmpeg (which is bad, the DRC was on doing encoding)
    - wav encoded with UsEac3To (which is good, DRC was off doing encoding)

    When you play the AC3 in VLC player, what result you get?
    Sounds it like the UseEac3To good or the clever FFmpeg bad wav?
    Try playing the AC3 with MPC-HC, which result you get there?

    To prevent the whole problematic is to encode all AC3 files with DRC to AC3 without DRC.
    (Better without reencoding, only change some metadata.)
    So I know, that ALL players (hardware or software) are playing it with the CORRECT dynamic ANYTIME.
    Image Attached Files
    Last edited by diginoob; 6th Sep 2025 at 02:48.
    Quote Quote  
  5. I haven't had a chance to play with your samples yet, but here's the default AC3 DRC settings for MPC-HC, VLC (Linux version) and foobar2000 (I don't recall disabling it myself in any of the players). It wouldn't surprise me if Windows Media Player doesn't have a similar option, but I haven't used that nightmare of a player since the Windows 98 era.

    I don't re-encode audio directly with ffmpeg itself all that much, but I was still disappointed to discover you're correct and it has AC3's DRC enabled by default. https://ffmpeg.org/ffmpeg-all.html#ac3

    If I had to choose between re-encoding to remove the DRC and making sure I used a player that'd ignore it though, I'd go for the latter myself, if possible.

    Image
    [Attachment 88578 - Click to enlarge]


    Image
    [Attachment 88579 - Click to enlarge]


    Image
    [Attachment 88580 - Click to enlarge]


    I hadn't actually thought about it, as when I use my PC to watch video I run the audio through the Dynamic Audio Normalizer myself, courtesy of MPV and ffmpeg (https://ffmpeg.org/ffmpeg-all.html#toc-dynaudnorm), but it did occur to me there'd be no point applying DRC twice. I couldn't find any mention of AC3's DRC in the SMPlayer or MPV log files, but the MPV docs indicate it's disabled.

    https://mpv.io/manual/stable/#options-ad-lavc-ac3drc
    --ad-lavc-ac3drc=<level>

    Select the Dynamic Range Compression level for AC-3 audio streams. <level> is a float value ranging from 0 to 1, where 0 means no compression (which is the default) and 1 means full compression (make loud passages more silent and vice versa). Values up to 6 are also accepted, but are purely experimental. This option only shows an effect if the AC-3 stream contains the required range compression information.

    The standard mandates that DRC is enabled by default, but mpv (and some other players) ignore this for the sake of better audio quality.
    Last edited by hello_hello; 6th Sep 2025 at 08:59.
    Quote Quote  
  6. Mhhh, DRC should be already turned off in VLC but I can hear, that it is on anyway.

    Image
    [Attachment 88588 - Click to enlarge]
    Quote Quote  
  7. For some reason foobar2000's internal AC3 decoder was unable to decode your AC3 sample, but I managed to use ffmpeg to decode it for foobar2000 instead.

    The results of a scan of the original AC3 (DRC disabled) and the various output files are in the screenshot below. I found it somewhat odd at first, as when DRC was applied the average volume increased a fraction and the peaks were about 2.5dB higher.

    I couldn't disable DRC while converting with VLC, and I couldn't work out why because I couldn't get it to write any sort of log file either. I've rarely used VLC so I'm not that familiar with it.

    Image
    [Attachment 88605 - Click to enlarge]


    I loaded the two foobar2000 conversions into Audacity for a look.
    AC3's DRC appears to increase the volume of the quiet parts as well as reduce the volume of the loader bits.
    The surround channels looked surprising though as visually they appear to be louder when DRC is enabled. It explains why the output with DRC applied has louder peaks than it does when DRC is disabled.

    No DRC
    Image
    [Attachment 88603 - Click to enlarge]


    With DRC
    Image
    [Attachment 88604 - Click to enlarge]
    Last edited by hello_hello; 7th Sep 2025 at 07:37.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!