Extracting Audio, Video and Subtitle tracks from Matroska Video (MKV) files
mkvtoolnix is a set of cross-platform command line tools (mkvmerge, mkvextract, and mkvinfo) for extracting audio, video and subtitle tracks from Matroska Video (.mkv) files. After extracting these tracks you can recombine them into an AVI container with subtitles embedded using a tool such as ffmpegX (a visual interface to mencoder available for OS X only) or mencoder (Linux).
mkvtoolnix can be downloaded here, or installed via MacPorts.
First, use mkvmerge to list the MKV file’s contents:
mkvmerge -i MovieFile.mkvYou’ll see a listing similar to this:
File 'MovieFile.mkv': container: Matroska Track ID 1: subtitles (S_TEXT/ASS) Track ID 2: audio (A_MPEG/L3) Track ID 3: video (V_MPEG4/ISO/AVC)
Next, use mkvextract to extract certain tracks / attachments based on the output from the above command:
mkvextract tracks MovieFile.mkv 1:thesubtitles.srt 2:theaudio.mp3 3:thevideo.mp4
mkvextract will extract the tracks you listed and save them to the specified filenames.
Related posts:
- Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc.)
- Converting RealVideo (RMVB, RealPlayer) files to AVI, MPEG, or MP4 on the Mac
- Bash Script to split a single CSV file into multiple files with headers
- Showing hidden files and directories in the Finder in Mac OS X
- Extract and sort email addresses from text files with Automator



03 Feb 2009 








author
Perfect. Easy and fast. Thank you very much!
Bravo! Thank you, you solved a great predicament for me
thanks i was looking for this and worked