Log in

View Full Version : Audio (FLAC) that is demuxed from MKV is shorter than the Video (AVC).


Mitchings
9th August 2011, 18:47
Hi there,

My PS3's BD drive has kicked the bucket and I obviously can't play any of my Blu-ray discs at the moment, I'm not too bothered about my movies for now as I'll be fixing it in a month or two as money's gotten a little tight, but it's my music/concert ones I wanna be able to play on a regular basis.

However, I do have the main feature from each of them backed up on my PC in MKV files with AVC video and the original lossless audio tracks on all 5.1+ discs and stereo lpcm tracks converted to flac.

What I'd like to be able to do is play them on the PS3, with either a simple MP4/TS file or an AVCHD folder dependant on what my preferences are for the particular title. And with a little tsmuxer this is quite straightforward.

One particular title I'm having a problem with however is Clapton & Winwood @ Madison Square Garden. I ripped this and encoded in MKV: AVC 720p/24 & FLAC (Lossless) 2.0 [the original track was LPCM 2.0] and the file works perfectly well with no apparent problems on PC.

However, to play back on my PS3 I need to make this into an LPCM stream which should be pretty straightforward, demux the mkv file into two streams; a .264 and a .flac stream, use foobar to convert the .flac to .wav and then remux the .264 and the .wav. But the extracted .flac keeps coming out at 2hrs 19mins rather than the full 2hrs 35mins, the last 16 minutes are completely missing, as if it's just chopped off, but it's all there in the full mkv file.

I'd just re-rip in an easier format but I've had to downgrade my laptop since and I'm back to bog-standard DVD/RW drive. I effectively have a bunch of useless blu-rays until I fix my drive and the only way I can play 'em for now with the full audio is to get these mkv files converted and playing well on my PS3.

So basically I have an MKV file and when I extract the flac audio it comes out shorter, I'm using MKVExtractGUI. I've also tried MKV Demux All and Eac3to but neither of those are even capable of getting the stream extracted.

I'm just wondering if anyone has any solutions or if there are any other programs I could use?

Any help is greatly appreciated, I play guitar and like to learn while watching, listening and playing along; and there's no better way than on a hdtv with a proper sound system.

Thanks,

Michael.

sneaker_ger
9th August 2011, 19:10
There might be an error in the file. You could try to open it via a program that ignores the error. Try AviSynth's DirectShowSource on the file and convert to wave with avs2pipe/wavi or something similar.

[P]ako
9th August 2011, 19:11
Use avisynth and the plugin ffmpegsource2 (http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html) to extract/transcode the audio to wav in virtualdub.

ramicio
9th August 2011, 19:35
What format PCM is the audio? How is eac3to not able to extract your streams? You probably have a corrupt file.

Mitchings
9th August 2011, 21:10
Thanks peeps, I'll try those options out in a bit and get back to you.

And the audio was originally LPCM 2Ch 24-Bit 48KHz and is now FLAC 2Ch 24-Bit 48KHz.

ramicio
9th August 2011, 21:28
2 hours and 19 minutes is right around 2 GB at 24/48, which is the limit for the size of a WAV file. I wouldn't be using foobar to do this, I would use eac3to to convert it to some sort of raw LPCM. What container is this going to end up going into in the end?

Mitchings
9th August 2011, 22:18
2 hours and 19 minutes is right around 2 GB at 24/48, which is the limit for the size of a WAV file. I wouldn't be using foobar to do this, I would use eac3to to convert it to some sort of raw LPCM. What container is this going to end up going into in the end?

It isn't foobar that's causing this as I haven't actually gotten to that part yet. That's just what I was planning to do, though I can of course use eac3to for that if need be. The conversion isn't the issue. It's simply that when I demux the flac from the mkv it comes out with 16minutes cut off.

When I play the MKV video file with the AVC video and FLAC audio it plays right up to the 2hr 35min mark where it should with no faults.

When I extract the FLAC file from that; the FLAC file is 2hrs 19mins when I play it by itself.

I just need to get that FLAC stream out of the MKV container with all 2hrs 35mins of audio in tact.

ramicio
9th August 2011, 22:20
Is this only with MKVExtract? What container is your end goal?

Mitchings
9th August 2011, 22:38
Is this only with MKVExtract? What container is your end goal?

Yep, MKVExtract(GUI) was the only program I found that would actually get the FLAC stream out of the MKV container.

TS - Transport Stream, preferably.

With AVC/H.264 Video (for which I already have the stream extracted and ready) and of course the LPCM Audio.

ramicio
9th August 2011, 22:40
And what is the issue you're having with eac3to reading the file?

Mitchings
10th August 2011, 00:34
And what is the issue you're having with eac3to reading the file?

I pop the mkv file in, go to the audio tab, select the audio track (it's recognised ok) and I've attempted to output it as flac (I also tried pcm, lpcm and wav on other occasions) but it says it's not supported in the cmd prompt window. I have all the paths for codecs etc. set correctly by the way.

ramicio
10th August 2011, 01:00
Could you upload a small cut sample of the MKV to somewhere?

Mitchings
10th August 2011, 01:24
Could you upload a small cut sample of the MKV to somewhere?

It's 1am here so I've gotta get to bed, but I'll try and get it done as soon as I can tomorrow.

Thanks again for the help so far..

setarip_old
10th August 2011, 01:24
@Mitchings

Hi! Yep, MKVExtract(GUI) was the only program I found that would actually get the FLAC stream out of the MKV container.
Have you tried "MKVcleaver"?

Ghitulescu
10th August 2011, 08:06
Won't be easier to get the original WAV/LPCM back? It may have been an encoding error, maybe a muxing one, who knows? It should be ~ length.

setarip_old
10th August 2011, 19:43
@Ghitulescu

Re-read the initial post to this thread: My PS3's BD drive has kicked the bucket and I obviously can't play any of my Blu-ray discs at the moment

Mitchings
10th August 2011, 20:54
Sorry I didn't get back to you sooner, had a garden to weed.

I had a brainstorm though, it seems the flac file cut off at the point of the credits (there's encores after the credits) so I thought that maybe there were two audio streams acting independently of each other albeit in the same stream. I'm not sure if that makes any sense.

Anywho, I just sliced the mkv file in two at the exact point the flac track was ending then I demuxed the two videos, converted the flacs to lpcm, muxed each back with their respective video stream, joined the two video streams in tsmuxer and output with chapters, 4gb splits (for fat32/ps3) and in an avhcd folder structure which I've made compliant with avchdme. :)

Thanks for your help anyways, much appreciated.

setarip_old
10th August 2011, 21:23
Glad to hear you've worked things out ;>}

hello_hello
10th August 2011, 21:24
I wonder if at the credits the audio format changes? Maybe from 5.1ch to stereo? Although it doesn't explain why the flac audio wasn't demuxed in it's entirety.
You should have been able to convert the audio using foobar though, without having to bother with demuxing it first. Foobar will play the audio in MKV files directly.

Ghitulescu
11th August 2011, 07:46
However, I do have the main feature from each of them backed up on my PC in MKV files with AVC video and the original lossless audio tracks on all 5.1+ discs and stereo lpcm tracks converted to flac.

@Ghitulescu
Re-read the initial post to this thread:
@setarip_old:
And you please read this excerpt from his OT.

setarip_old
11th August 2011, 08:21
@Ghitulescu

I believe you are misinterpreting what Mitchings has stated.

Perhaps he can post back here to clarify his statements: My PS3's BD drive has kicked the bucket and I obviously can't play any of my Blu-ray discs at the momentI effectively have a bunch of useless blu-rays until I fix my drive and the only way I can play 'em for now with the full audio is to get these mkv files converted and playing well on my PS3.

Ghitulescu
11th August 2011, 09:21
Not at all.
Instead of using the broken FLAC from the MKV he can reuse the PC to reextract the WAV/LPCM from the originals (they should work) like before, remuxing them for PS3 (I've heard that's a special procedure, I don't own a PS3) and feed them via an alternative route to PS3 (Network). The drive of PS3 may be broken, but the PC is not and I don't really think it has lost its ability to rip BDs. While a compressed file is more prone to errors than an uncompressed one, I think this is the way to go. At least this is how I would do it.