Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to extract subtitles from MP4 and MKV movies. I'm using mp4box (on OS X) but cannot figure out how it works.

Any hints?

share|improve this question
up vote 25 down vote accepted

MP4 and 3GP files

The free and cross-platform MP4Box only works with MP4 or 3GP containers. You can install it from the homepage. First, you want look at the different tracks and see which ID belongs to the subtitle track.

MP4Box -info input.mp4

Look at the ID next to the subtitle track. Then, based on the track ID <trackId> you want to extract, call the following command:

MP4Box -raw <trackID> input.mp4

Or, to export to the commonly used SRT format:

MP4Box -srt <trackID> input.mp4

MKV files

In order to extract subtitles from Matroska (MKV) files, you need the free and open source mkvtoolnix packages. They come for Windows and Linux, and on a Mac you can install them through Homebrew with brew install mkvtoolnix.

Then, inspect the file:

mkvmerge -i input.mkv

This will list the tracks, for example like this:

File 'input.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AAC)
Track ID 3: subtitles (S_TEXT/UTF8)

Based on the ID of the track, call the following command, where <trackID> is the one you identified above. <output> is just a dummy name, you can use any you want.

mkvextract tracks input.mkv <trackID>:<output>.srt

So, in our case, that would have been:

mkvextract tracks input.mkv
share|improve this answer
This all works for linux too. I found MP4Box in the gpac package available via apt-get – aidan Jun 12 '14 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .