Kodi Community Forum

Full Version: Extracting LPCM from MKV?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

I'm in the process of trying to convert a few files and need some help.

The files I'm trying to convert are MKV files created with MakeMKV from a Bluray source, and have LPCM sound. What I'm trying to do is to convert these LPCM sound tracks to FLAC.

I'm using Ubuntu 10.04, 64-bit, and any advice on what software to use would be greatly appreciated. If I can transcode within the mkv, then great, if not, could someone please recommend a working way to demux the sound track so I can use the FLAC encoder on it, then remux with mkvtoolnix?

Thanks. Smile
Try avidemux.
Thanks for the help but unfortunately that doesn't seem to work. I loaded the mkv into avidemux, and selected "Audio --> Save", but got the following error:

Code:
Assert failed :nbLaces<MKV_MAX_LACES
at line 213, file /build/build-avidemux_2.5.3-1~getdeb1-amd64-aSAHqC/avidemux-2.5.3/avidemux/ADM_inputs/ADM_matroska/ADM_mkv_audio.cppADM_backTrack
mkvAudio::getPacket(unsigned char*, unsigned int*, unsigned int*, unsigned int*)
mkvAudio::getPacket(unsigned char*, unsigned int*, unsigned int*)
ADM_Composer::getAudioPacket(unsigned char*, unsigned int*, unsigned int*)
A_saveAudio(char*)
A_audioSave(char*)
FileSel_ReadWrite(void (*)(char const*), int, char const*, char const*)
avidemux2_gtk() [0x540138]
HandleAction(Action)
guiCallback(_GtkMenuItem*, void*)
g_closure_invoke

g_signal_emit_valist
g_signal_emit
gtk_widget_activate
gtk_menu_shell_activate_item


g_closure_invoke

The program seemed a bit complex for what I'm trying to achieve anyway. All I really need is a way to extract the LPCM to a separate file (WAV or AIFF or whatever) so I can use the FLAC encoder on it.

Any more suggestions?
You could probably use mkvextract not used it in linux myself ?
mplayer with the -dumpaudio flag comes to mind.
@X, I tried mkvextract, but it seems to have a problem with the LPCM track.

@bobo1on1, thanks for the tip. I'll try that and see what happens.
Ok, I tried mplayer -dumpaudio, and I got a file of the correct size, but it won't play in anything and FLAC won't work on it. The command I used was:
Code:
mplayer -dumpaudio -dumpfile audio.lpcm myfile.mkv

Did I do something wrong?
That would dump the audio encoded i suspect.
Encoded as what? I thought PCM was pretty much uncompressed? What format should it be dumped into for FLAC to be able to encode it, and can I do that with mplayer?
*bump* - Anyone?
ffmpeg -i someinfile -acodec flac -o someoutfile.flac
That should work.
Thanks bobo1on1 - that worked!
why was this necessary?

I'm curious because I use makemkv to do lossless rips and I like it that way.. however, my only two LPCM blu's I've done so far do not produce any audio in XBMC.

Even after finally getting the DTS-MA and TrueHD logos to appear on my AVR I still get the silent treatment from the LPCM mkv's.. MPC plays the same files perfectly.. my AVR just says "PCM" though?

hmm..