LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   extracting audio from "dual audio" video file ? (https://www.linuxquestions.org/questions/linux-general-1/extracting-audio-from-dual-audio-video-file-895014/)

dEnDrOn 08-02-2011 12:30 AM

extracting audio from "dual audio" video file ?
 
i've a video file(.mkv) having two audio tracks in english & german.
I want to extract the english audio.
I tried converting the file to .mp3 using ffmpeg but its output is german audio !

corp769 08-02-2011 12:55 AM

Hello,

Have you ever tried using mkvextract? http://linux.die.net/man/1/mkvextract

Cheers,

Josh

dEnDrOn 08-02-2011 02:03 AM

Quote:

Originally Posted by corp769 (Post 4431302)
Hello,

Have you ever tried using mkvextract? http://linux.die.net/man/1/mkvextract

Cheers,

Josh

I already read it but didn't really got how to make it work.
Please elaborate !

corp769 08-02-2011 07:48 AM

Ok, here it goes....

Say you have a file called movie5.mkv.... From the command line, run the following:
Code:

mkvinfo movie5.mkv
Typing that on my computer results in the following:
Code:

+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ EBML maximum ID length: 4
|+ EBML maximum size length: 8
|+ Doc type: matroska
|+ Doc type version: 2
|+ Doc type read version: 2
+ Segment, size 106828593
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 187)
|+ EbmlVoid (size: 4096)
|+ Segment information
| + Segment UID: 0xbb 0x91 0xd8 0x17 0x1b 0x2c 0x4c 0x51 0xca 0x2c 0xd7 0x52 0x06 0x1d 0x33 0x6d
| + Writing application: HandBrake 0.9.4
| + Timecode scale: 1000000
| + Duration: 267.267s (00:04:27.267)
|+ Segment tracks
| + A track
|  + Track number: 1
|  + Track UID: 254519045
|  + Track type: video
|  + Lacing flag: 0
|  + Codec ID: V_MPEG4/ISO/AVC
|  + CodecPrivate, length 44
|  + Default duration: 33.367ms (29.970 fps for a video track)
|  + Default flag: 1
|  + MinCache: 1
|  + Video track
|  + Pixel width: 526
|  + Pixel height: 296
|  + Display width: 526
|  + Display height: 296
| + A track
|  + Track number: 2
|  + Track UID: 1116757863
|  + Track type: audio
|  + Lacing flag: 0
|  + Codec ID: A_AC3
|  + Language: und
|  + Default flag: 1
|  + Audio track
|  + Sampling frequency: 48000
|  + Channels: 2
|+ Cluster

Now, knowing that information, we can see that the audio we want to extract is located on track 2, and it is encoded as AC3. From here, we can now do the following:
Code:

mkvextract tracks movie5.mkv 2:audio_track.ac3
From here, you can convert it using whatever you would like. Hope this helps.

Cheers,

Josh

dEnDrOn 08-02-2011 07:47 PM

Quote:

Originally Posted by corp769 (Post 4431586)
Code:

mkvextract tracks movie5.mkv 2:audio_track.ac3
From here, you can convert it using whatever you would like. Hope this helps.

Cheers,

Josh

i got it now !
thanks !!

dEnDrOn 08-02-2011 07:48 PM

marking thread as solved !

corp769 08-02-2011 07:55 PM

No problem, and cheers!

-Josh


All times are GMT -5. The time now is 03:23 PM.