HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: consultant on 2010-04-02 23:02:22

Title: Extract FLAC from MKV and Convert to AC3?
Post by: consultant on 2010-04-02 23:02:22
I've having the toughest time figuring out how to extract the FLAC audio from an MKV and then convert it to AC3 so I can remux to a VOB or m2ts to play via USB HDD on my Playstation 3.

I tried the MKVExtract in MKVToolnix.  MKCEXtractGUI won't demux FLAC.  So I tried command line like this:

mkvextract --no-ogg source.mkv 1:video.264 2:audio.flac

It is interesting even though I used --no-ogg options the status message still says it is writting to ogg container. Does the no-ogg option not work so this is causing the problem?

Then I tried EAC2ToGUI and I get "the format of the source file cannot be detected"  I get a similar error if I try to play the .FLAC file in VLC but after it displays
the error, it plays fine anyway.

Help!
Title: Extract FLAC from MKV and Convert to AC3?
Post by: UED77 on 2010-04-03 00:54:19
I tried to reproduce your situation, but everything works fine for me. I'm using mkvextract v3.2.0 "Beginnings".

First, I created an MKV file with mkvmerge by importing the H.264 video from another MKV and a (native) FLAC file. Then I used for the following mkvextract command line:
Code: [Select]
C:\apps\mkvmerge>mkvextract tracks --no-ogg C:\test\muxed.mkv 2:"C:\test\demuxed.flac"

Extracting track 2 with the CodecID 'A_FLAC' to the file 'C:\test\demuxed.flac'.
Container format: raw data
Progress: 100%


The resulting file is a native FLAC file. Are you using the latest version of mkvtoolnix?
Title: Extract FLAC from MKV and Convert to AC3?
Post by: DVDdoug on 2010-04-05 19:52:02
I don't know if it will work with your file, but SUPER (http://www.erightsoft.com/SUPER.html)[/color] (FREE!!!) has helped me with "difficult formats" a few times. (It does support MKV & FLAC).
Title: Extract FLAC from MKV and Convert to AC3?
Post by: probedb on 2010-04-05 21:10:48
Have you tried Handbrake? That'll convert audio to AAC/MP3 which is compatible with the PS3 (or at least it'll play anyways). Not sure if Handbrake can deal with FLAC tho it is good with most stuff.
Title: Extract FLAC from MKV and Convert to AC3?
Post by: cathywht on 2013-01-04 05:23:14
Google is your friend. Google search "Techisky convert MKV FLAC to AC3" to easy solve your issue.
Title: Extract FLAC from MKV and Convert to AC3?
Post by: Rollin on 2013-01-04 07:20:56
ffmpeg
ffmpeg.exe -i file.mkv -vn -acodec ac3 -ab 320k file.ac3
You will get ac3 file with bitrate 320 kbps
Title: Extract FLAC from MKV and Convert to AC3?
Post by: The Seeker on 2013-01-04 09:33:34
I've found XMedia Recode (http://www.videohelp.com/tools/XMedia-Recode) to be the best tool for this kind of thing.
Title: Extract FLAC from MKV and Convert to AC3?
Post by: nastea on 2013-01-04 12:07:41
I've having the toughest time figuring out how to extract the FLAC audio from an MKV and then convert it to AC3 so I can remux to a VOB or m2ts to play via USB HDD on my Playstation 3.

I tried the MKVExtract in MKVToolnix.  MKCEXtractGUI won't demux FLAC.  So I tried command line like this:

mkvextract --no-ogg source.mkv 1:video.264 2:audio.flac

It is interesting even though I used --no-ogg options the status message still says it is writting to ogg container. Does the no-ogg option not work so this is causing the problem?

Then I tried EAC2ToGUI and I get "the format of the source file cannot be detected"  I get a similar error if I try to play the .FLAC file in VLC but after it displays
the error, it plays fine anyway.

Help!


First of all, there's no flac-audio in an mkv file. Chances are that the sound is already stored as AC3 in the mkv file, with up to 6 channels.
Maybe its a good idea to extract the sound to wav, and afterwards convert the wav to the type of AC3 you need.
For extracting the sound of any video file, you might give these programs a try:
Quick Media Converter, Aura Video to Audio Converter
(they helped me out in similar situations)
Good luck!
Title: Extract FLAC from MKV and Convert to AC3?
Post by: Soap on 2013-01-04 12:25:31
First of all, there's no flac-audio in an mkv file.


Come again?

The simplest of Google searches would quickly show that this is an increasingly common situation with poor hardware and software decoding support (thus the question).  Or did you just think that all the other replies failed to catch such a blatant error?
Title: Extract FLAC from MKV and Convert to AC3?
Post by: nastea on 2013-01-04 12:44:31
First of all, there's no flac-audio in an mkv file.


Come again?

The simplest of Google searches would quickly show that this is an increasingly common situation with poor hardware and software decoding support (thus the question).  Or did you just think that all the other replies failed to catch such a blatant error?


I've just never seen it, all the mkv movies I ever played on my pc had AC3 or MPEG AAC Audio (mp4a) as soundstream.
Title: Extract FLAC from MKV and Convert to AC3?
Post by: Soap on 2013-01-04 12:49:59
I've never seen a kangaroo, but if someone asked me how to extract a Joey from  its mother's pouch I wouldn't tell OP kangaroo's don't exist!
Title: Extract FLAC from MKV and Convert to AC3?
Post by: nastea on 2013-01-04 12:56:07
I've never seen a kangaroo, but if someone asked me how to extract a Joey from  its mother's pouch I wouldn't tell OP kangaroo's don't exist!


Your kangaroo talk isn't really helping the OP.
But even if sometimes flac is used in mkv files that does not make much of a difference regarding the suggestions I did for how to extract the sound etc.
Title: Extract FLAC from MKV and Convert to AC3?
Post by: Kohlrabi on 2013-01-04 13:29:26
I've never seen a kangaroo, but if someone asked me how to extract a Joey from  its mother's pouch I wouldn't tell OP kangaroo's don't exist!


Your kangaroo talk isn't really helping the OP.
How was your misinformation about MKV any more helpful? MKV can store virtually any audio or video codec, just because certain dubious sources use it to spread movies across the net with certain codecs doesn't mean it's limited to that.

Also, this thread already has a plethora of good solutions to the problem at hand. For completeness' sake, let's have the full ffmpeg commandline to mux to MPEG2-TS:
Code: [Select]
ffmpeg -i videofile -i audiofile.mkv -c:v copy -c:a ac3 -b:a 448k -c:s copy out.m2ts

If the MKV containing the FLAC does also contain the video stream, you can of course omit the "-i videofile". Also you may have to specify the number of channels for ac3 encoding if the FLAC is multichannel ("-ac 6").