Log in

View Full Version : LPCM to FLAC within MKV?


lloydsmart
6th August 2010, 17:30
Hello. Hopefully my thread title makes it pretty clear what I'm trying to achieve. Basically, I have some MKVs that were created by MakeMKV from a bluray source. These MKVs contain 5.1 LPCM audio tracks, and I'd like to convert these to 5.1 FLAC to save space. I don't mind demuxing and remuxing the file, but I'm having trouble extracting the LPCM track from the MKV files so that it can be processed by the FLAC encoder.

I should mention that I'm running on Ubuntu 10.04 64-bit, but will also consider any software that will run properly under Wine.

Can anyone help me? I've tried mkvdemux, tsMuxeR, Avidemux, eac3to, and mplayer with the -dumpaudio flag. No luck so far in producing a "normal" wav file that FLAC can process.

Any hints would be greatly appreciated. Thanks!

b66pak
6th August 2010, 18:36
cut a sample (20mb) with mkvmerge and post it (use mediafire)...make sure is playing proper before posting it!
_

Ghitulescu
6th August 2010, 19:22
You want actually to demux an LPCM track from an MKV using any available linux(Ubuntu) software or any software that works under wine subsystem. Is this your question?

Maybe I'm wrong, but is flac able to cope with more than 2 channels? Sorry, I used it only for CD audio, that's all I need.

nurbs
6th August 2010, 19:49
Maybe I'm wrong, but is flac able to cope with more than 2 channels? Sorry, I used it only for CD audio, that's all I need.
Yes, and even if you don't know that 5 seconds going to wikipedia and looking for the flac article will answer that question.

lloydsmart
6th August 2010, 23:26
Here's a clip from the file as requested.

http://www.mediafire.com/?dj0om0202p1nkor

TinTime
7th August 2010, 01:23
I've tried mkvdemux, tsMuxeR, Avidemux, eac3to, and mplayer with the -dumpaudio flag. No luck so far in producing a "normal" wav file that FLAC can process

How about using eac3to to produce a flac file directly?

roozhou
7th August 2010, 03:57
If your mplayer can play this mkv, use fifo and mplayer -ao pcm:fast:file=xxx where xxx is the name of fifo.

Or you can directly convert LPCM to flac using ffmpeg:
ffmpeg -i input.mkv -vn -sn -acodec flac audio.flac
After that remux to mkv using mkvmerge.

lloydsmart
7th August 2010, 08:52
ffmpeg -i input.mkv -vn -sn -acodec flac audio.flac

Thanks roozhou, that seems to have worked!

b66pak
7th August 2010, 18:53
this work for me (in WinXP SP3):
eac3to v3.22
command line: eac3to clip.mkv clip.flac
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 1 subtitle track, 0:00:13, 24p /1.001
1: h264/AVC, English, 1080p24 /1.001 (16:9)
2: RAW/PCM, English, 5.1 channels, 16 bits, 48kHz, -330ms
"3/2+1"
3: Subtitle (PGS), English
Track 2 is used for destination file "clip.flac".
[a02] Extracting audio track number 2...
[a02] Reading RAW/PCM...
[a02] Applying RAW/PCM delay...
[a02] Encoding FLAC with libFlac...
[a02] Creating file "clip.flac"...
[a02] The original audio track has a constant bit depth of 16 bits.
Video track 1 contains 625 frames.
eac3to processing took 1 second.
Done.
_