SVN 4829 - Center Channel missing on DPLII mixdown

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

SVN 4829 - Center Channel missing on DPLII mixdown

Post by mithrandir »

I noticed the audio volume was too low on encodes I made earlier today using a recent HB build. Upon further review I determined that the 5.1 mixdown to DPLII must have ignored or severely attenuated the center channel. This is probably a result of changeset 4825: "Eliminates our builtin downmix in favour of avresample".

Encode #1
[11:21:57] * audio track 1
[11:21:57] + decoder: English (BD LPCM) (5.1 ch) (track 1, id 0x1100)
[11:21:57] + mixdown: Dolby Pro Logic II
[11:21:57] + encoder: AC3 (ffmpeg)
[11:21:57] + bitrate: 224 kbps, samplerate: 48000 Hz

Encode #2
[19:54:48] * audio track 1
[19:54:48] + decoder: English (TrueHD) (5.1 ch) (track 2, id 0x721100)
[19:54:48] + mixdown: Dolby Pro Logic II
[19:54:48] + encoder: AC3 (ffmpeg)
[19:54:48] + bitrate: 224 kbps, samplerate: 48000 Hz

This seems to be a HD audio issue. When I mixdown to DPLII from a 5.1 AC3 source the audio levels appear fine.
Last edited by mithrandir on Mon Jul 16, 2012 2:35 am, edited 1 time in total.
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by mithrandir »

[User deleted]
Deleted User 11865

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by Deleted User 11865 »

libavresample seems to produce lower levels when downmixing, compared to John's old downmix code. However, there shouldn't be any difference between the center channel and the other channels, when compared to the old downmix code. I just checked and I certainly don't notice "severe attenuation" of the center channel compared to left & right.

Are you playing this on a Stereo setup or via a DPL2-compatible setup? Does using a pure Stereo mixdown make any difference?
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by mithrandir »

I initially was using my TV's built-in speakers, pure 2ch stereo. I just replayed the video again, this time over my 5.1 system with a DPLII receiver. You are right that the relative volume of the 5 individual channels appears correct.

If I play a pre-SVN4829 encode at 100% volume in VLC, I need to raise it to about 140% for the SVN4829 encode to sound equally loud on a 2-channel setup. Because the levels are noticeably lower with libavresample I thought there was a problem with the downmix.

However, this volume level issue occurs only with uncompressed (HD) audio sources. For instance create an encode with the following 4 audio tracks:

#1: uncompressed pass-through
#2: uncompressed downmix to DPLII, Stereo or Mono
#3: 5.1 AC3 pass-through
#4: 5.1 AC3 downmix to DPLII, Stereo or Mono

#1 and #2 should be about the same in level as should #3 and #4. But I'm finding that #2 is always lower in level than #1 (all for targets: DPLII, Stereo and Mono). #3 and #4 are about the same. If I apply 6 dB of gain to track #2 (on the audio tab), then #1 and #2 are equal volume.
Deleted User 11865

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by Deleted User 11865 »

The AC3 decoder doesn't use libavresample for downmixing (yet). It will eventually do, however. There are advantages to using libavresample that are more important than a lower volume (which can be adjusted with gain):

1) support for Left Surround, Right Surround and Center Surround channels simultaneously (e.g. standard 6.1 audio), which John's old downmix code didn't have

2) support for Left Front of Center and Right Front of Center channels, which John's old downmix code didn't have

3) support for sample format conversion (from and to HandBrake's internal 32-bit float format), which previously was a bit of a hack (as demonstrated by the initially broken 0.9.7 release)

4) support for upmixing as well as downmixing, so you can take e.g. a 4.0 source and encode it as 5.1, rather than having to downmix to Dolby or Stereo

5) support for changing input characteristics, so that if your audio suddenly switches from say, 5.1 to Stereo mid-stream, remixing parameters are adjusted on-the-fly and you still get correct audio output

The difference between #1 and #2 is not something we have control over - output track #1 will be downmixed externally, so volume will depend on whatever playback device you're using. It's true that libavresample is quite conservative with the output volume (presumably, to avoid clipping).
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by mithrandir »

OK, I understand now why the HD-sourced encodes are lower in volume. This is not a bug.

Does Handbrake apply audio gain before or after any downmix? If it's after the downmix then it should be relatively safe to apply the 6 dB gain. However if it's before the downmix then any positive gain risks clipping.
Deleted User 11865

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by Deleted User 11865 »

It's actually after, I think. Downmixing happens right after decoding the audio, and, unless I am mistaken, before it reaches the A/V sync code, which is where gain is applied for now.
Deleted User 11865

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by Deleted User 11865 »

Well, there's your volume back: https://trac.handbrake.fr/changeset/4884 (tomorrow's nightly).
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by mithrandir »

Yes, I got the 4887 CLI and can confirm that the audio levels are back to "normal" and don't need any gain adjustment. Thanks for that.
Deleted User 11865

Re: SVN 4829 - Center Channel missing on DPLII mixdown

Post by Deleted User 11865 »

mithrandir wrote:Yes, I got the 4887 CLI and can confirm that the audio levels are back to "normal" and don't need any gain adjustment. Thanks for that.
Well, no… their are no longer normal-ized :P
Post Reply