Pages Menu
TwitterRssFacebook
icsulescu
1. pron. nehot. cineva 2. s. m. sg. (peior.) persoană neînsemnată
Categories Menu

Posted by on Nov 9, 2012 in Linux

Extract MKV (Matroska) subtitles on Linux (Ubuntu)

Install MKVToolNix (cross-platform set of tools to create, alter and inspect Matroska files):

sudo apt-get install mkvtoolnix

Find the subtitle track number and the attachment IDs of the fonts using mkvinfo tool:

mkvinfo file.mkv

or using the GUI version:

mkvinfo -g

Assuming the subtitles are track 3, extract them using mkvextract tool:

mkvextract tracks file.mkv 3:file.***

Optionally extract also the font (by not specifying a file name for the font, the filename of the attached font will be used; this needs to be done for each font that is attached):

mkvextract attachments file.mkv FontID:

Install the fonts and regenerate the font cache so that the subtitles will be rendered properly:

cp *.ttf ~/.fonts
sudo fc-cache -v ~/.fonts

Make sure that the file is in MSDOS (CR-LF) format by using flip command:

sudo apt-get install flip
flip -m file.srt

Tags: , , , ,

Post a Reply