Page 1 of 1

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue Apr 25, 2023 1:13 am
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

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue Apr 25, 2023 8:47 am
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!

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue Apr 25, 2023 9:21 am
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue Apr 25, 2023 1:47 pm
by SomeHumanPerson
Please hold... an operator will be with you shortly.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Wed Apr 26, 2023 4:37 pm
by Rocky
A test stream is now in hand and investigation has begun.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Wed Apr 26, 2023 8:13 pm
by SomeHumanPerson
*waits with bated breath* :D

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Sat Apr 29, 2023 5:03 pm
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Sat Apr 29, 2023 7:04 pm
by Sherman

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Sat Apr 29, 2023 9:13 pm
by SomeHumanPerson
Is that a fix specific to this disc, or does it generalize to handle other possible non-standard PCM channel counts?

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Sun Apr 30, 2023 7:04 am
by Rocky

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 11:48 am
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 12:43 pm
by Sherman

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 6:21 pm
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 7:34 pm
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 8:22 pm
by Sherman
You tell em!

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Mon May 01, 2023 10:21 pm
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

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue May 02, 2023 7:10 am
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue May 02, 2023 8:48 am
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).

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue May 02, 2023 12:24 pm
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.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue May 02, 2023 1:00 pm
by Rocky
I slipstreamed DGDemux build 66 with support for extensible. Will do DGIndexNV when I finish up a feature for Zathor.

Demuxed LPCM 3.0 (Perspecta) is messed up

Posted: Tue May 02, 2023 6:51 pm
by SomeHumanPerson
Excellent! Thank you for all of your work on this.