BookTranslator
BookTranslator

Extract Subtitles From an MKV or MP4: Text Tracks, Image Tracks, and What You Can Translate

Check which kind of subtitle track your video carries, then extract it with ffmpeg or mkvextract. A three-track sample file shows what works, what fails, and why.

BookTranslator

BookTranslator Team

8 min read

Before you extract anything, find out what kind of subtitle track the video holds. A text track (SubRip, ASS, WebVTT, or MP4's mov_text) comes out as a small file you can open, edit, and translate. An image track (Blu-ray PGS or DVD VobSub) is a series of pictures of words. You can copy it out, but you cannot turn it into an SRT by changing the file extension or the output format. It needs OCR first.

The check takes one command, and it decides everything that follows.

Step 1: List the subtitle tracks

Run ffprobe, which ships with FFmpeg, on the video:

ffprobe -v error -select_streams s \
  -show_entries stream=index,codec_name:stream_tags=language,title:stream_disposition=default,forced,hearing_impaired \
  -of compact movie.mkv

This is the output for the sample file we built for this guide: a seven-second MKV with one SubRip track, one ASS track, and one PGS image track.

stream|index=2|codec_name=subrip|disposition:default=1|disposition:forced=0|disposition:hearing_impaired=0|tag:language=eng
stream|index=3|codec_name=ass|disposition:default=0|disposition:forced=0|disposition:hearing_impaired=0|tag:language=fre
stream|index=4|codec_name=hdmv_pgs_subtitle|disposition:default=0|disposition:forced=0|disposition:hearing_impaired=0|tag:language=eng|tag:title=English (image)

Read three fields:

  • index is the number you will pass to -map. Streams 0 and 1 are video and audio, so subtitles start at 2 here.
  • codec_name tells you the track type. This is the field that matters.
  • forced and hearing_impaired tell you whether a track holds only forced lines (signs and foreign dialogue) or adds sound descriptions. A forced track can be a handful of lines, so check it before you pick it as your source.

The language tag is written by whoever made the file and is sometimes missing or wrong. Open the extracted file and look before trusting it.

Step 2: Decide from the codec name

codec_name in ffprobeUsual containerKindExtract asReady to translate?
subripMKVText.srtYes
ass (also SSA)MKVText with styles.assYes, keep it as ASS
webvttWebM, MKVText.vttYes
mov_textMP4, MOVText.srt (converted)Yes, after conversion
hdmv_pgs_subtitleMKV from Blu-rayImages.supNo, needs OCR
dvd_subtitleMKV or VOB from DVDImages.sub and .idx (mkvextract)No, needs OCR

If every track you need is in the top four rows, the rest of this guide takes a few minutes. If the only track in your language, or the only usable source track, is PGS or VobSub, plan for an OCR and proofreading step before any translation.

Step 3: Extract a text track

With ffmpeg

Copy a SubRip track out by its index:

ffmpeg -i movie.mkv -map 0:2 -c copy english.srt

-map 0:2 means stream 2 of the first input. The ffmpeg documentation also lets you select by type and by metadata, which is handy when you process many files whose track order differs. 0:s:0 is the first subtitle stream, and the m:key:value form matches a metadata tag:

ffmpeg -i movie.mkv -map 0:s:m:language:fre -c copy french.ass

In our sample, the extracted english.srt had the same cues, text, and timestamps as the SRT we had put into the file; the only difference was one extra blank line at the end. The ASS track came out with its [Script Info] header, both styles, and every override tag intact.

With mkvextract

If you use MKVToolNix, mkvextract does the same job for MKV files. Its documentation gives the form mkvextract source-filename tracks TID:dest-filename, where the track IDs come from mkvmerge --identify. It writes SubRip tracks as SRT, ASS and SSA tracks as ASS and SSA, PGS tracks as SUP, and VobSub tracks as a SUB file with an IDX index. MKVToolNix numbers tracks itself, so check mkvmerge --identify rather than reusing the ffprobe index.

We ran the commands in this guide with ffmpeg 9.0.1 on macOS on November 9, 2026. We did not run mkvextract for this article.

The MP4 exception

MP4 files store text subtitles as mov_text, which the SRT muxer does not accept as-is. Copying the stream fails:

$ ffmpeg -i movie.mp4 -map 0:2 -c copy subs.srt
[srt @ ...] Unsupported subtitles codec: mov_text

Leave out -c copy and ffmpeg converts the track to SubRip:

ffmpeg -i movie.mp4 -map 0:2 subs.srt

In our sample MP4, the converted file had the same two cues and timestamps as the source SRT.

Do not convert ASS to SRT before translating

ffmpeg will happily turn an ASS track into an SRT if you ask for one. Here is what that did to the French track in our sample. The source events:

Dialogue: 0,0:00:01.00,0:00:03.50,Default,,0,0,0,,Le ferry part à sept heures.
Dialogue: 0,0:00:04.00,0:00:06.50,Default,,0,0,0,,{\i1}Prends le dossier bleu{\i0},\Npas le rouge.
Dialogue: 0,0:00:01.00,0:00:06.50,Sign,,0,0,0,,{\pos(320,40)}QUAI 3

The SRT that ffmpeg -i movie.mkv -map 0:3 french.srt produced:

1
00:00:01,000 --> 00:00:03,500
<font size="24">Le ferry part à sept heures.</font>

2
00:00:01,000 --> 00:00:06,500
<font size="18" color="#ffff00"><b>{\an8}QUAI 3</b></font>

3
00:00:04,000 --> 00:00:06,500
<font size="24"><i>Prends le dossier bleu</i>,
pas le rouge.</font>

Three things changed. The style table was flattened into <font> tags on every line. The sign's exact position, \pos(320,40), became a generic top-center code, {\an8}: an ASS instruction now sitting inside an SRT file, where it works only if the player happens to read ASS codes. And the second style, a yellow sign at the top of the frame, is now just another cue in the list, so a translator sees it mixed into the dialogue.

None of that helps translation. A translation tool now has to carry HTML-like tags and a stray ASS code through every line, and the result can no longer be put back into the original styled track. If the track is ASS, extract it as ASS and translate the ASS file. Our guide to translating ASS/SSA subtitles explains which parts of an ASS file to translate and which to leave alone.

Image tracks: what extraction gives you

Asking ffmpeg to write the PGS track as SRT fails before it starts:

$ ffmpeg -i movie.mkv -map 0:4 english.srt
[sost#0:0/srt @ ...] Subtitle encoding currently only possible from text to text or bitmap to bitmap
Error opening output file english.srt.

The message is literal. A PGS track contains no characters, only bitmaps and the times to show them. Copying it out works:

ffmpeg -i movie.mkv -map 0:4 -c copy english.sup

The resulting .sup file is the same set of pictures. To get text you have to run OCR over those images and then proofread the result against the video, because OCR errors in subtitles are easy to miss: a misread l and I, a dropped accent, or two lines merged into one. Treat that as its own job. Do not feed raw OCR output straight into translation.

Before you commit to OCR, check whether another source exists. A different release of the same video, or a subtitle file published for that release, may give you a text subtitle in the same language, which saves the OCR and proofreading pass entirely.

Which track to translate from

When the video has several text tracks, the source you choose affects the translation more than the tool does.

  • Prefer the original-language track when it exists. Translating from a translation compounds its choices and errors.
  • Prefer a full track over a forced one. A forced track may hold only signs and foreign-language lines.
  • Prefer a plain track over an SDH one unless you want the sound descriptions translated too. A hearing_impaired track adds lines such as [door slams] that a dialogue track does not have.
  • Check the timing against the video after extraction. A track from a different release can be offset by a few seconds or drift because of a different frame rate. Fix that before translating, because every translated line inherits the timing.

Translate the extracted file

Once you have an .srt, .vtt, or .ass file in the language you want to translate from, the remaining job is translation. BookTranslator's subtitle translator accepts SRT, VTT, ASS, and SSA files. It translates the cue text and writes the result back into the same format with the original timing. If you want the source and translation on screen together, see how to make bilingual subtitles. If the extracted text shows garbled characters, fix the encoding first with our subtitle encoding guide.

Two limits to keep in mind. BookTranslator does not take video files or image-based .sup and .sub subtitles, so extraction and any OCR happen before upload. And extract subtitles only from videos you are entitled to use; an extracted subtitle file is for your own viewing, not for republishing.

Quick reference

GoalCommand
List subtitle tracksffprobe -v error -select_streams s -show_entries stream=index,codec_name:stream_tags=language -of compact movie.mkv
Copy SubRip from MKVffmpeg -i movie.mkv -map 0:2 -c copy subs.srt
Copy ASS from MKVffmpeg -i movie.mkv -map 0:3 -c copy subs.ass
Pick a track by languageffmpeg -i movie.mkv -map 0:s:m:language:fre -c copy subs.ass
Convert MP4 mov_text to SRTffmpeg -i movie.mp4 -map 0:2 subs.srt
Copy PGS out as imagesffmpeg -i movie.mkv -map 0:4 -c copy subs.sup

Replace the stream numbers with the ones ffprobe shows for your file.

Related Posts

Extract Subtitles From an MKV or MP4: Text Tracks, Image Tracks, and What You Can Translate