Bad audio in BD-rip

Everything related to MakeMKV
Post Reply
Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Bad audio in BD-rip

Post by Barleyman » Sat Jun 27, 2009 4:47 pm

Ripping vicky cristina barcelona BD, I get unplayable audio. MPC with every internal filter is powerless, as is the normal setup with haali + ffdshow + ac3filter.

Cannot connect audio to compatible filter as it was. From the BD data it should be just bog-standard stereo LPCM.

mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Bad audio in BD-rip

Post by mike admin » Sun Jun 28, 2009 8:04 am

This one is complex. The LPCM on this particualr disc is not stereo - it is 3/0 LPCM (L,R,C). The only format that can preserve multi-channel LPCM and channel assignment is "exteneded WAV" - so MakeMKV writes track in this format if LPCM contains more than 2 channels. Unfortunately, the only player that correctly plays this format is Mplayer. VLC has separate code for playing standalone wav files and wav inside MKV, so so it would play demuxed wav just fine but will not play the same wav in MKV. From your description it looks like both MPC and haali have trouble demuxin it.

There are two solutions and both are ugly.

1. Maybe the problem is not with splitter but with 3-channel wav - try to play with your speaker configuration.
2. Patch MKV file manually to change WAV format from extended to "plain PCM" you will loose channel assignment but gain compatibility. In order to patch you'll need to change first two bytes in codec private from FEFF to 0100 . These bytes are just after "A_MS/ACM" string in MKV file, in your file they should be near offset 0x1c8 .

I would appreciate if you can try to change MKV file and post results here. Thanks.

ninjai
Posts: 8
Joined: Tue Jun 09, 2009 8:26 pm

Re: Bad audio in BD-rip

Post by ninjai » Sun Jun 28, 2009 10:53 am

mike admin wrote:Unfortunately, the only player that correctly plays this format is Mplayer. VLC has separate code for playing standalone wav files and wav inside MKV, so so it would play demuxed wav just fine but will not play the same wav in MKV. From your description it looks like both MPC and haali have trouble demuxin it.
Did you try to play this file with a newer beta version of mpc? http://www.xvidvideo.ru/content/category/1/1/2/
But overall mplayer is the much better and stable player. Look fot the smplayer package (mplayer + GUI, as mplayer is a cli only program).

Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Re: Bad audio in BD-rip

Post by Barleyman » Sun Jun 28, 2009 2:52 pm

mike admin wrote:There are two solutions and both are ugly.

1. Maybe the problem is not with splitter but with 3-channel wav - try to play with your speaker configuration.
2. Patch MKV file manually to change WAV format from extended to "plain PCM" you will loose channel assignment but gain compatibility. In order to patch you'll need to change first two bytes in codec private from FEFF to 0100 . These bytes are just after "A_MS/ACM" string in MKV file, in your file they should be near offset 0x1c8 .

I would appreciate if you can try to change MKV file and post results here. Thanks.
Changing speakers didn't do anything. Also changing mkv audio type didn't really work. If i have AC3filter set up to accept PCM input, I will get loud static. Otherwise nobody seems to want to handle the PCM stream, which is a bit odd.. OK, I can make ffdshow accept the pcm stream but it will pass the buck to the next filter, not put it out to directsound! Also after changing the bits mkvmerge says the audio stream is "PCM", originally it says it's "unknown" so maybe there's something wrong with how makemkv creates the wav file?

Why cannot you write the LPCM stream as-is? At least ffdshow claims it can handle LPCM input?

Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Re: Bad audio in BD-rip

Post by Barleyman » Sun Jun 28, 2009 6:38 pm

Here's the "can't connect filter" message from mpc.

\\MEDIABOX\Movies\Vicky_Cristina_Barcelona\title00.mkv::Audio

Media Type 0:
--------------------------
Audio: PCM 48000Hz 3ch 3456Kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 0
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 3
nSamplesPerSec: 48000
nAvgBytesPerSec: 432000
nBlockAlign: 9
wBitsPerSample: 24
cbSize: 22 (extra bytes)

pbFormat:
0000: 01 00 03 00 80 bb 00 00 80 97 06 00 09 00 18 00 ....?»..?—......
0010: 16 00|18 00 07 00 00 00 01 00 00 00 00 00 10 00 ................
0020: 80 00 00 aa 00 38 9b 71 ?..?.8›q

Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Re: Bad audio in BD-rip

Post by Barleyman » Sun Jun 28, 2009 8:15 pm

OK, I also tried this with smplayer. I get same nice loud static as with the patched MKV file when you pipe it to ac3filter. So it appears the audio is NOT ok for whatever reason.

Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Re: Bad audio in BD-rip

Post by Barleyman » Tue Jun 30, 2009 7:27 pm

Wav files can't be >2GB..

mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Bad audio in BD-rip

Post by mike admin » Thu Jul 02, 2009 7:02 am

Channel assignment will be lost if written as PCM. We'll probably add an option to do so anyway in next version.

Barleyman
Posts: 9
Joined: Sat Jun 27, 2009 4:24 pm

Re: Bad audio in BD-rip

Post by Barleyman » Sat Jul 04, 2009 4:23 pm

I tried this with Buzzqw's HDConverttoX and found out a few things.

First of all, making a wav doesn't work out because of the 2GB limit. Second, for whatever reason the LPCM track is recognized as L/R + back center, which seems unlikely to say the least. That makes an effect with 5.1 speakers that the people are speaking inside your head which is funny for about 30 seconds and really tiresome afterwards.

What did work OK was encoding the track as FLAC (and forcing it to be mixed to stereo)

Post Reply