Demuxed LPCM 3.0 (Perspecta) is messed up

Post Reply
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

Here's a fun one for you:

https://www.blu-ray.com/movies/Yojimbo- ... ay/332600/
https://www.amazon.co.jp/Yojimbo-4K-Blu ... B0BV122JDJ

In spite of what Blu-ray.com says, this disc has the 3.0 "Perspecta" audio track in LPCM (not Dolby Digital).

The stereo (dual mono) LPCM track demuxes flawlessly, but the 3.0 track comes out messed up. The file size is precisely double that of the 2.0-channel track, instead of 150%, and the sound is garbled like mad. In a spectrogram it looks absolutely crazy.

Demuxing the same track to .W64 in eac3to v3.3.4 succeeds properly, yielding a 3-channel file of the appropriate size that looks good in spectrograms and sounds fine on playback.

Here's MediaInfo from the DGDemux-ed track:

Code: Select all

General
Complete name                            : E:\Yojimbo_UHD PID 1101 jpn DELAY 0ms.w64
Format                                   : Wave64
File size                                : 3.56 GiB
Duration                                 : 2 h 27 min
Overall bit rate mode                    : Constant
Overall bit rate                         : 3 456 kb/s

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 2 h 27 min
Bit rate mode                            : Constant
Bit rate                                 : 3 456 kb/s
Channel(s)                               : 3 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Stream size                              : 3.56 GiB (100%)

ReportBy                                 : MediaInfoLib - v22.12
And here's the same track from eac3to:

Code: Select all

General
Complete name                            : E:\Y30_eac3to.w64
Format                                   : Wave64
File size                                : 2.67 GiB
Duration                                 : 1 h 50 min
Overall bit rate mode                    : Constant
Overall bit rate                         : 3 456 kb/s

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 00000001-0000-0010-8000-00AA00389B71
Duration                                 : 1 h 50 min
Bit rate mode                            : Constant
Bit rate                                 : 3 456 kb/s
Channel(s)                               : 3 channels
Channel layout                           : L R C
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Stream size                              : 2.67 GiB (100%)

ReportBy                                 : MediaInfoLib - v22.12
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

Never heard of or came across an LPCM 3.0 so it's no surprise it's not working. I'll have to order the disk and try to fix it.

EDIT: $75 ouch. Do you know of any other cheaper disks (preferably available from US Amazon) that have LPCM 3.0?

EDIT2: Found 'Vicky Cristina Barcelona' bluray for $18. Ordered.

EDIT3: Uh-oh. Found on the web: "Technically, my receiver tells me that the signal it received from my Blu-ray player for this disc was encoded in uncompressed PCM 5.1 format. However, only the front three channels have any activity in them, making this actually a 3.0 configuration." So it's not true LPCM 3.0. Order cancelled. Help me find an affordable disk please!
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

Maybe we can do it this way: Can you give me a 100MB sample of the M2TS file that contains this audio? Then I can debug it in DGIndexNV.
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

Please hold... an operator will be with you shortly.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

A test stream is now in hand and investigation has begun.
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

*waits with bated breath* :D
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

We have to wrap it as WAVE_FORMAT_EXTENSIBLE instead of WAVE_FORMAT_PCM. Also not write out superfluous data for 3 channel format.
User avatar
Sherman
Posts: 576
Joined: Mon Jan 06, 2020 10:19 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Sherman »

User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

Is that a fix specific to this disc, or does it generalize to handle other possible non-standard PCM channel counts?
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

Turns out we just need to delete the extra 4th channel data as stored on the bluray. We already do that for mono PCM (i.e., delete the extra second channel data), so it was just a simple addition based on the mono data deletion. Extensible format is not necessary here. I have it working and will make a release, possibly today.
User avatar
Sherman
Posts: 576
Joined: Mon Jan 06, 2020 10:19 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Sherman »

User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

Released fix as build 66. Thank you for reporting this and supporting the debugging.

If we run into any 20-bit streams, then we will need to implement extensible. I've never seen one although they are allowed on a bluray.
User avatar
Curly
Posts: 712
Joined: Sun Mar 15, 2020 11:05 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Curly »

SomeHumanPerson wrote:
Wed Apr 26, 2023 8:13 pm
waits with bated breath
Lucky for you it wasn't baited breath, because then you'd smell fishy. Knerk.
User avatar
Sherman
Posts: 576
Joined: Mon Jan 06, 2020 10:19 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Sherman »

You tell em!
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

Rocky wrote:
Mon May 01, 2023 6:21 pm
Released fix as build 66. Thank you for reporting this and supporting the debugging.

If we run into any 20-bit streams, then we will need to implement extensible. I've never seen one although they are allowed on a bluray.
Thanks for the fix! :salute:

Is implementing WAVE_FORMAT_EXTENSIBLE a substantial task?


Curly wrote:
Mon May 01, 2023 7:34 pm
SomeHumanPerson wrote:
Wed Apr 26, 2023 8:13 pm
waits with bated breath
Lucky for you it wasn't baited breath, because then you'd smell fishy. Knerk.
I care about spelling. :D
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

SomeHumanPerson wrote:
Mon May 01, 2023 10:21 pm
Is implementing WAVE_FORMAT_EXTENSIBLE a substantial task?
No, it's easy. Formally, extensible is needed for nchans > 2, but in practice all apps are quite happy without it. I'll go ahead and implement extensible. I avoided it because I'm not sure if extensible is OK for nchans < 3 and didn't want to have two wrapper functions. But it's not that big of a deal. I'm curious to see which one eac3to uses for nchans < 3. Probably best to duplicate what eac3to is doing. I'll slipstream it into build 66.
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

There's at least one stereo example in that specification that you linked, so it would seem that EXTENSIBLE should be safe for nchans < 3 unless other applications have poor implementations that create compatibility problems (not that you have any reason to be beholden to broken 3rd-party tools).
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

Yes, I agree. I have coded extensible and tested it on the 3.0 stream. Got binary identical to eac3to.

Still have to regression test all our LPCM files. Then I will release for both DGDemux and DGIndexNV.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by Rocky »

I slipstreamed DGDemux build 66 with support for extensible. Will do DGIndexNV when I finish up a feature for Zathor.
User avatar
SomeHumanPerson
Posts: 96
Joined: Fri Mar 24, 2023 10:41 am

Demuxed LPCM 3.0 (Perspecta) is messed up

Post by SomeHumanPerson »

Excellent! Thank you for all of your work on this.
Post Reply