Export & Codecs

MKV Extract Subtitles: SRT, ASS and PGS With Free Tools

MKV Extract Subtitles: SRT, ASS and PGS With Free Tools
Image: Vipid

To mkv extract subtitles, you identify the subtitle track with mkvmerge --identify, then pull it out with mkvextract. Text tracks (SRT, ASS, WebVTT) come out as ready-to-use files in seconds. Image-based tracks (PGS, VobSub) come out as bitmaps and need an OCR pass before they become editable text. This tutorial walks through both routes in ten steps, ending with a script that handles a whole folder.

Everything here uses free tools. MKVToolNix 104.0 (codename Chimera) is the current release, according to the project’s own downloads page, and FFmpeg 9.1 (Gauss) is the newest stable FFmpeg release. If your package manager lags, FFmpeg’s installation notes explain how to build it from source. For the file you end up with, our explainer on the SRT subtitle file covers the format line by line.

Why bother? Creators extract subtitles to fix a typo before re-uploading, to translate a track into another language, to feed captions into an editor, or to keep the text when they re-encode a file into MP4. The container stays untouched. Extraction is a read-only operation, so your original MKV is never modified.

Prerequisites: Tools, Versions and What Each One Does

You need two free command-line toolkits and one free editor. The table lists the current versions as checked on December 1, 2026. Subtitle Edit is only required for the OCR route, so skip it if your file carries text subtitles.

ToolCurrent version (checked Dec 1, 2026)PriceRole in this tutorial
MKVToolNix (mkvmerge, mkvextract)104.0Free, open sourceList tracks, extract text, PGS and VobSub tracks
FFmpeg (ffmpeg, ffprobe)9.1Free, open sourceAlternative extraction, ASS to SRT conversion
Subtitle EditVersion 5 line, stable build from the project siteFree, open sourceOCR for PGS and VobSub, cleanup, timing fixes
Python3.9 or newerFreeRuns the batch script in the working project
A text editorAny, VS Code or Notepad++ suggestedFreeInspect the extracted files

System requirements matter for MKVToolNix. The official downloads page says the current 104.0 installer and portable archive support Windows 10 or Windows Server 2016 and newer. On Linux, the project ships a distribution-agnostic AppImage that needs glibc 2.28 or later. macOS disk images returned in May 2026 for release 98 onward, built by two community members after the maintainer had said he would stop providing macOS binaries.

Subtitle Edit moved recently too. According to the project’s changelog and GitHub release page, version 5 added native Windows, macOS and Linux builds in June 2026, and 5.4.0 was reportedly published as the stable release on November 6, 2026, with 5.5.0 beta builds still circulating. Treat betas as test software. Use the stable download unless you want to hunt bugs.

You also need an MKV file you have the right to work with. Subtitle text is a copyrighted work, like the film it belongs to. Extract from your own recordings, your own encodes, and files you hold a licence for. Everything below runs locally on your machine, with no upload step.

How MKV Stores Subtitles: Text Tracks vs Bitmap Tracks

Matroska is a container, so subtitles live in separate tracks beside the video and audio. Each track has a codec ID that tells you what kind of subtitle it is. That ID decides your whole workflow. Text subtitles are literal characters with timestamps, and they extract to a normal file. Bitmap subtitles are pictures of text, so you get an image-based file that a player can draw but an editor cannot read.

Illustrative: Shiny silver optical disc seen from its data side
Photo: Kent Madsen, CC BY-SA 2.0, via Wikimedia Commons
FormatCodec ID in MKVKindExtracts toTo get SRT
SubRip (SRT)S_TEXT/UTF8Text.srtNothing to convert
Advanced SubStation Alpha (ASS)S_TEXT/ASSText with styling.assConvert, styling is lost
SubStation Alpha (SSA)S_TEXT/SSAText with styling.ssaConvert, styling is lost
WebVTTS_TEXT/WEBVTTText.vttConvert with FFmpeg or Subtitle Edit
PGS (Blu-ray)S_HDMV/PGSBitmap.supOCR in Subtitle Edit
VobSub (DVD)S_VOBSUBBitmap.idx plus .subOCR in Subtitle Edit

The MKVToolNix documentation and the mkvextract man page agree on this split. Text subtitles keep their native format on the way out, so an SRT track becomes an .srt file and an ASS track becomes an .ass file. PGS tracks extract as .sup files. VobSub tracks extract as a pair, an .idx index and a matching .sub file, and both must stay together in the same folder.

If you want to see what the text formats look like inside, our page of example subtitle files in SRT, VTT and ASS shows each one with copyable samples. Container choices like Matroska sit in the wider world of export formats, and our export and codecs hub collects the related guides.

Why the Difference Decides Your Workflow

Blu-ray rips almost always carry PGS. DVD rips carry VobSub. Anime releases and fan encodes lean on ASS because it supports fonts, colors and on-screen positioning. Web rips and screen recordings with captions usually carry SRT or WebVTT. Knowing the family before you extract saves a wasted afternoon, because a .sup file will never open as readable text no matter which editor you try.

Step 1: Install MKVToolNix and FFmpeg

Install both tools first, then confirm each answers from the terminal. The command-line programs matter more than the windows. On Windows, download the MKVToolNix installer or the portable 7zip archive from the official downloads page. On macOS, use the project disk images or Homebrew. On Linux, use your distribution package or the project repositories.

# Debian and Ubuntu
sudo apt install mkvtoolnix ffmpeg

# Fedora
sudo dnf install mkvtoolnix ffmpeg

# macOS with Homebrew
brew install mkvtoolnix ffmpeg

# Windows with winget
winget install MoritzBunkus.MKVToolNix
winget install Gyan.FFmpeg

Distribution packages can trail the project by several releases. The MKVToolNix download page notes that Ubuntu 22.04 users can still get versions up to 88.0 from the project’s repositories, and Ubuntu 20.04 users up to 81.0. Extraction works fine on those older builds, but you miss fixes. Add the project’s own repository if you want 104.0 on an older Ubuntu.

Now verify the install. Each command should print a version string. If the shell says command not found, the install folder is not on your PATH. On Windows the default folder is C:\Program Files\MKVToolNix, and you can either add it to PATH or use the full path in every command.

mkvmerge --version
mkvextract --version
ffmpeg -version
ffprobe -version

Expected output on a current install begins like this. Your build string and compile flags will differ.

mkvmerge v104.0 ('Chimera') 64-bit
mkvextract v104.0 ('Chimera') 64-bit
ffmpeg version 9.1 Copyright (c) 2000-2026 the FFmpeg developers

A note on the bundled GUI. The MKVToolNix GUI is built for muxing and editing track headers. If you want point-and-click extraction, the separate third-party gMKVExtractGUI wraps mkvextract in a window. This tutorial sticks to the command line because every GUI runs the same commands underneath, and the commands are easier to script.

Step 2: List Every Track Before You Extract

Never guess a track number. Run mkvmerge --identify on the file and read the IDs it prints. This single habit prevents the most common failure in the whole topic, which is extracting the wrong stream. The ID that MKVToolNix prints counts every track in the file, including video and audio.

mkvmerge --identify movie.mkv

Example output for a typical Blu-ray rip. The names and flags are illustrative, so expect your own file to differ.

File 'movie.mkv': container: Matroska
Track ID 0: video (HEVC/H.265/MPEG-H)
Track ID 1: audio (E-AC-3)
Track ID 2: audio (AC-3)
Track ID 3: subtitles (SubRip/SRT)
Track ID 4: subtitles (SubStation Alpha)
Track ID 5: subtitles (HDMV PGS)
Track ID 6: subtitles (HDMV PGS)
Chapters: 24 entries

Read the output in two passes. First, find the lines that say subtitles and note their IDs, here 3 to 6. Second, read the codec in brackets to sort text from bitmap. Tracks 3 and 4 are text. Tracks 5 and 6 are PGS bitmaps. For language, flags and track names, add the -J switch for JSON output, which is also what the working project script reads.

mkvmerge -J movie.mkv

The JSON lists each track’s codec_id, language, track_name, default_track and forced_track under its properties block. Those fields tell you which English track is the full dialogue track and which one is the forced-only track, a distinction Step 8 returns to.

The FFmpeg View of the Same File

FFprobe numbers streams differently, and mixing the two schemes is the classic mistake. Its index counts all streams from zero, and the 0:s:N map selector counts only subtitle streams. Run this to see what FFmpeg sees.

ffprobe -v error -select_streams s -show_entries stream=index,codec_name:stream_tags=language,title:stream_disposition=default,forced -of compact movie.mkv
stream|index=3|codec_name=subrip|DISPOSITION:default=1|DISPOSITION:forced=0|TAG:language=eng|TAG:title=English
stream|index=4|codec_name=ass|DISPOSITION:default=0|DISPOSITION:forced=0|TAG:language=eng|TAG:title=Signs and Songs
stream|index=5|codec_name=hdmv_pgs_subtitle|DISPOSITION:default=0|DISPOSITION:forced=0|TAG:language=eng|TAG:title=English (PGS)
stream|index=6|codec_name=hdmv_pgs_subtitle|DISPOSITION:default=0|DISPOSITION:forced=1|TAG:language=eng|TAG:title=Forced

Compare the two listings. The SRT track is MKVToolNix ID 3, FFmpeg stream index 3, and subtitle-only position 0:s:0. The ASS track is ID 4, index 4, position 0:s:1. The first two numbers agree here only because this file has no attachments. FFmpeg counts attached fonts as streams and MKVToolNix does not, so a file with fonts will show different numbers in the two tools. Rely on the numbers from the tool you are about to run.

Step 3: Extract Text Subtitles With mkvextract

For text tracks, mkvextract is the shortest path. The syntax is the input file, the word tracks, then one or more pairs of track ID and output name. Current documentation puts the source file first. Older guides show the mode first, so if your build complains, check mkvextract --help on your install.

mkvextract movie.mkv tracks 3:movie.eng.srt
Extracting track 3 with the CodecID 'S_TEXT/UTF8' to the file 'movie.eng.srt'. Container format: SRT text subtitles
Progress: 100%

That is the whole job for an SRT track. Open movie.eng.srt in a text editor and you should see numbered cues, each with a timecode line and one or two lines of text. If the file is empty or tiny, the track may simply hold few lines, as forced tracks often do.

Several Tracks in One Pass

You can pull several tracks in a single command, which reads the file once instead of repeatedly. Separate the pairs with spaces. Choose the file extension that matches the codec, because mkvextract writes the track’s native format regardless of the name you give it.

mkvextract movie.mkv tracks 3:movie.eng.srt 4:movie.eng.signs.ass

Naming an ASS track with an .srt extension does not convert it. It produces an ASS file with the wrong name, and many players will refuse to parse it. Match extension to codec every time, using the format table above as your lookup.

Fonts and Attachments for ASS Tracks

ASS subtitles often depend on fonts stored inside the MKV as attachments. If an extracted ASS file looks wrong in another player, the fonts are missing. List attachments with the identify command, then extract them by their attachment ID.

mkvextract movie.mkv attachments 1 2 3

Install those fonts on the system that will render the ASS file, or keep them in the same folder if your player supports that. Without the fonts, the player falls back to a default face and your carefully positioned signs can shift or overflow.

Step 4: Extract Subtitles With FFmpeg Instead

FFmpeg is the right choice when you already have it open for a conversion, when you want WebVTT output, or when you are scripting around streams rather than track IDs. It takes the stream selector -map 0:s:N, where N counts subtitle streams from zero. The basic form is ffmpeg -i input.mkv -map 0:s:0 output.srt, and the commands below build on it.

# first subtitle stream, copied as SRT
ffmpeg -hide_banner -i movie.mkv -map 0:s:0 -c:s copy movie.eng.srt

# second subtitle stream, copied as ASS
ffmpeg -hide_banner -i movie.mkv -map 0:s:1 -c:s copy movie.eng.signs.ass

# first subtitle stream, converted to WebVTT
ffmpeg -hide_banner -i movie.mkv -map 0:s:0 movie.eng.vtt

The -c:s copy flag keeps the track as is. Without it, FFmpeg picks an encoder from the output extension, which is exactly how you convert SRT to WebVTT in the third command. FFmpeg prints a long log, and the useful lines are the ones that begin with Stream mapping near the end, which confirm which subtitle stream went to which file.

Stream mapping:
  Stream #0:3 -> #0:0 (copy)
Output #0, srt, to 'movie.eng.srt':
  Stream #0:0(eng): Subtitle: subrip

FFmpeg has one hard limit. It cannot turn a bitmap subtitle into text. Ask it to convert a PGS stream to SRT and it stops with an error saying subtitle encoding is only possible from text to text or bitmap to bitmap. For PGS and VobSub, use mkvextract and OCR, as Steps 6 and 7 show. The next table compares the routes.

RouteBest forHandles PGS and VobSubNumbering usedPrice
mkvextractExact native-format extraction, batchesYes, as .sup or .idx plus .subMKVToolNix track ID (counts all tracks)Free
FFmpegFormat conversion, scripting with streamsNo text conversion, bitmap copy only0:s:N (counts subtitle streams only)Free
Subtitle EditOCR, cleanup, timing, visual reviewYes, with OCR to SRTPick from a track listFree
gMKVExtractGUIPoint-and-click extraction on WindowsYes, through mkvextractMKVToolNix track IDFree

Step 5: Convert ASS to SRT Without Wrecking the Result

Many editors, uploaders and platforms accept SRT and nothing else, so an ASS track often needs converting. The conversion is lossy. ASS carries fonts, colors, outlines, screen positions and animated effects, and SRT carries only text, timing and a few basic tags. You keep the words and lose the look.

ffmpeg -hide_banner -i movie.eng.signs.ass movie.eng.signs.srt

You can also skip the intermediate file and convert straight from the MKV by mapping the ASS stream and naming an .srt output, because FFmpeg selects the SubRip encoder from the extension.

ffmpeg -hide_banner -i movie.mkv -map 0:s:1 movie.eng.signs.srt

Check the result before you trust it. Typesetting tracks, the ones that style signs and on-screen text, convert badly. You may get dozens of near-duplicate lines, one per animation frame, or text pieces that read out of order. A dialogue-only ASS track converts cleanly. A signs-and-songs track usually deserves a manual look in Subtitle Edit.

Subtitle Edit does the same conversion with more control. Open the .ass file, choose SubRip from the format dropdown on the main window, and save. Its Fix common errors tool then merges short lines, removes stray override tags and fixes overlapping times in one pass. For typesetting-heavy files, that cleanup is worth the minute it takes.

Step 6: Extract PGS and VobSub Bitmap Subtitles

The command is the same as for text. Only the output extension changes. Use .sup for PGS and .idx for VobSub. For VobSub, mkvextract writes the .idx file you name and creates the matching .sub file next to it, so keep both files together.

# PGS track (Blu-ray)
mkvextract movie.mkv tracks 5:movie.eng.sup

# VobSub track (DVD), writes movie.eng.idx and movie.eng.sub
mkvextract movie.mkv tracks 7:movie.eng.idx
Extracting track 5 with the CodecID 'S_HDMV/PGS' to the file 'movie.eng.sup'. Container format: HD DVD PGS subtitles
Progress: 100%

Do not open the .sup in a text editor. It is a binary stream of image data, and it will look like garbage. That is normal. The file is complete and valid, and it plays back correctly in players that understand Blu-ray subtitles. It simply has no text for a keyboard to edit until OCR creates some.

When You Want the Bitmap Itself

Sometimes OCR is not the goal. If you are re-muxing a Blu-ray rip into a new MKV, or keeping a pixel-exact copy of the original subtitle, the .sup file is exactly what you want. Bitmap subtitles preserve the original typography, which is why disc releases use them. Keep the .sup as an archive copy and make an OCR’d SRT alongside it for searching and editing.

Step 7: OCR the Bitmap Track Into SRT With Subtitle Edit

Subtitle Edit turns images into text. Open the extracted .sup file from the File menu. The program detects a bitmap subtitle and opens its OCR window. You can also open the original MKV, and Subtitle Edit will list the embedded tracks and let you pick one, which skips the extraction step. Both routes land in the same OCR window.

Set the OCR method first. Recent Subtitle Edit versions offer several engines, including built-in image comparison, Tesseract and newer model-based options. The project’s changelog for 5.4.0 reportedly lists new OCR models, so check the dropdown in your build. Pick your language in the engine settings, because the wrong language gives you nonsense words.

Then work through this sequence in the OCR window:

  1. Choose the OCR engine and the language of the subtitle.
  2. Press Start OCR and let it run, which takes minutes for a feature-length track.
  3. Answer prompts for unknown characters. Type the correct letter once and the program remembers it.
  4. Watch the spell-check panel. It flags words that are not in the dictionary, and most flagged words are OCR errors.
  5. Fix the classic confusions, capital I against lowercase l, zero against the letter O, and rn against m.
  6. Press OK, then save as SubRip (.srt) from the File menu.

Expect to correct a handful of lines in a clean disc rip. Expect more in low-contrast, italic-heavy or anti-aliased tracks. The honest summary is that OCR output is a very good first draft and never a final file. Read the finished SRT once while the video plays, and fix what the OCR got wrong.

Before saving, run Fix common errors from the Tools menu. It removes double spaces, fixes line breaks and repairs the I/l confusion across the whole file using the dictionary for your language. Save a copy of the raw OCR output first, so you can compare if the cleanup changes more than you intended.

Step 8: Pick the Right Track and Check the File

Many files carry several tracks in the same language, and picking the wrong one is the second most common failure after the wrong ID. Read the language tag, the forced flag, the default flag and the track name together. The table below decodes what each combination usually means.

Track labelWhat it containsExtract it when
Language set, no flagsFull dialogue in that languageYou want a complete subtitle file
Forced flag setOnly foreign-language lines and on-screen textYou need the signs or foreign dialogue only
Default flag setThe track players show automaticallyYou want what viewers see by default
Name mentions SDH or hearing impairedDialogue plus sound descriptions and speaker labelsYou are building captions for accessibility
Language undetermined (und)Unknown, the muxer never set a tagOpen it and read before you rely on it
Name mentions Signs or SongsTypeset on-screen text, often ASSYou need typesetting, not dialogue

A forced track is the trap. It holds a few dozen lines, so it extracts instantly and looks like it worked. If your extracted SRT is only 2 KB for a two-hour film, you grabbed the forced track. Go back to the identify output and choose the sibling track with the same language and no forced flag.

Verify the Extracted File

Run three quick checks on every extraction. First, open the file in a text editor and confirm the language and the first and last cue. Second, load it beside the video in a player such as VLC or mpv and check sync at the start, the middle and the end. Third, confirm the encoding. Matroska stores text subtitles as UTF-8, so extracted text files should be UTF-8, and accented characters should display correctly.

# quick sanity checks on the extracted SRT
head -n 12 movie.eng.srt
tail -n 8 movie.eng.srt
file -i movie.eng.srt

If you plan to pass the file to an older tool that expects a legacy encoding, convert it deliberately instead of hoping. For example, iconv -f UTF-8 -t WINDOWS-1252 in.srt > out.srt does it on Linux and macOS. Otherwise keep UTF-8, which every current player and editor reads without trouble.

Step 9: Fix Timing Drift and Offsets

Extracted subtitles keep the timestamps they had in the MKV, so they match the original video. If they drift, the video changed after the subtitle was made, or you are pairing the subtitle with a different cut. Check where the offset starts. A constant offset is easy to fix, while a drift that grows over time points to a frame rate mismatch.

Illustrative: Angled view of a computer monitor showing a command-line window filled with rows of green numbers on a black
Photo: Tibe De Kort / Pexels

For a constant shift, FFmpeg can move every cue by a fixed number of seconds. The command below delays a subtitle file by 2.5 seconds and copies the format unchanged. Use a negative value to move the cues earlier.

ffmpeg -hide_banner -itsoffset 2.5 -i movie.eng.srt -c copy movie.eng.shifted.srt

Subtitle Edit gives you the visual route. Use the Synchronization menu, then Adjust all times, and enter a value in milliseconds. It also offers point sync, where you mark the first and last spoken line against the video and the tool stretches everything between them. That is the fix for a growing drift.

One more case deserves a mention. If you extract from an MKV and the cues start a few seconds late against the same MKV, the container may carry a track delay that your player applies. When you re-mux, the --sync option sets a delay, for example --sync 0:2500 on the subtitle input delays it by 2500 milliseconds.

Step 10: Extract From a Whole Folder With a Script

Once the one-file routine works, scale it. If your folder holds a season of episodes or a month of recordings, a shell loop handles the simple case where every file has the same layout. The loop below pulls the first subtitle stream from each MKV with FFmpeg. The -nostdin flag matters, because without it FFmpeg can swallow the loop’s input and stop after the first file.

for f in *.mkv
do
  ffmpeg -nostdin -hide_banner -loglevel error -i "$f" -map 0:s:0 -c:s copy "${f%.mkv}.srt"
done

That loop assumes the first subtitle stream is the one you want and that it is text. Real collections break both assumptions. The project in the next section reads each file’s track list, keeps text tracks by default, includes PGS and VobSub on request, filters by language and tags forced and SDH tracks in the filename.

Complete Working Project: mkv-subs.py

Save this as mkv-subs.py. It needs Python 3.9 or newer and MKVToolNix on your PATH. It calls mkvmerge -J to read each file, builds one job per matching subtitle track and runs a single mkvextract call per file. It never touches the original MKV.

#!/usr/bin/env python3
"""Extract subtitle tracks from every MKV file in a folder."""
import argparse
import json
import re
import shutil
import subprocess
import sys
from pathlib import Path

TEXT_CODECS = {
    "S_TEXT/UTF8": "srt",
    "S_TEXT/ASS": "ass",
    "S_TEXT/SSA": "ssa",
    "S_TEXT/WEBVTT": "vtt",
}
BITMAP_CODECS = {
    "S_HDMV/PGS": "sup",
    "S_VOBSUB": "idx",
}


def identify(mkv):
    result = subprocess.run(
        ["mkvmerge", "-J", str(mkv)],
        capture_output=True,
        text=True,
        check=True,
    )
    return json.loads(result.stdout)


def safe(text):
    return re.sub(r"[^A-Za-z0-9]+", "-", text).strip("-").lower()


def build_jobs(mkv, outdir, want_bitmap, langs):
    jobs = []
    for track in identify(mkv)["tracks"]:
        if track["type"] != "subtitles":
            continue
        props = track["properties"]
        codec = props.get("codec_id", "")
        ext = TEXT_CODECS.get(codec)
        if ext is None and want_bitmap:
            ext = BITMAP_CODECS.get(codec)
        if ext is None:
            print("  skip track " + str(track["id"]) + ": " + codec + " not selected")
            continue
        lang = props.get("language", "und")
        if langs and lang not in langs:
            continue
        tags = [lang]
        if props.get("forced_track"):
            tags.append("forced")
        name = props.get("track_name", "").lower()
        if "sdh" in name or "hearing" in name:
            tags.append("sdh")
        tags.append("t" + str(track["id"]))
        target = outdir / (mkv.stem + "." + ".".join(safe(t) for t in tags) + "." + ext)
        jobs.append((track["id"], target))
    return jobs


def extract(mkv, jobs):
    pairs = [str(tid) + ":" + str(target) for tid, target in jobs]
    subprocess.run(["mkvextract", str(mkv), "tracks", *pairs], check=True)


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("folder", type=Path, help="folder with .mkv files")
    parser.add_argument("--out", type=Path, help="output folder (default: same as input)")
    parser.add_argument("--bitmap", action="store_true", help="also extract PGS and VobSub")
    parser.add_argument("--lang", action="append", default=[], help="keep only this language, e.g. eng (repeatable)")
    parser.add_argument("--dry-run", action="store_true", help="print the plan, extract nothing")
    args = parser.parse_args()

    for tool in ("mkvmerge", "mkvextract"):
        if shutil.which(tool) is None:
            sys.exit(tool + " not found on PATH. Install MKVToolNix first.")

    outdir = args.out or args.folder
    outdir.mkdir(parents=True, exist_ok=True)
    files = sorted(args.folder.glob("*.mkv"))
    if not files:
        sys.exit("No .mkv files found in " + str(args.folder))

    total = 0
    for mkv in files:
        print(mkv.name)
        try:
            jobs = build_jobs(mkv, outdir, args.bitmap, args.lang)
        except subprocess.CalledProcessError as err:
            print("  could not read file: " + str(err))
            continue
        if not jobs:
            print("  no matching subtitle tracks")
            continue
        for tid, target in jobs:
            print("  track " + str(tid) + " -> " + target.name)
        if not args.dry_run:
            extract(mkv, jobs)
        total += len(jobs)

    print("Done. " + str(total) + " track(s) " + ("planned." if args.dry_run else "extracted."))


if __name__ == "__main__":
    main()

Run it with a dry run first. That prints the plan and writes nothing, so you can confirm it picked the tracks you expect.

python3 mkv-subs.py ./episodes --lang eng --dry-run
python3 mkv-subs.py ./episodes --lang eng --out ./subs
python3 mkv-subs.py ./discs --bitmap --lang eng --out ./subs
episode-01.mkv
  track 3 -> episode-01.eng.t3.srt
  track 4 -> episode-01.eng.t4.ass
  skip track 5: S_HDMV/PGS not selected
episode-02.mkv
  track 3 -> episode-02.eng.t3.srt
  track 4 -> episode-02.eng.t4.ass
  skip track 5: S_HDMV/PGS not selected
Done. 4 track(s) planned.

Rename the outputs if you like. Many media servers want a name such as Movie.eng.forced.srt, which the script already follows apart from the track marker such as t3. The marker stops two same-language tracks from overwriting each other, so remove it only after you have confirmed a file has one track per language.

Common Pitfalls

These six mistakes account for most failed extractions. Each one is easy to avoid once you know it exists.

  • Using the subtitle number as the track ID. MKVToolNix IDs count video and audio too. The first subtitle track is rarely ID 0. Always read the identify output.
  • Mixing MKVToolNix IDs with FFmpeg map numbers. The first scheme counts all tracks, and 0:s:N counts subtitles only. Use the numbers from the tool you are running.
  • Expecting PGS to open as text. A .sup file is an image stream. You need OCR to get words out of it.
  • Converting ASS to SRT and expecting the styling to survive. Colors, fonts and positions disappear. Keep the ASS original as an archive copy.
  • Grabbing the forced track. A tiny file means a forced-only track. Pick the full track in the same language.
  • Overwriting files with identical names. Two English tracks extracted to movie.srt leave you with one file and a missing track. Include the track ID in the name.

A seventh trap sits outside the tools. Hardcoded subtitles are burned into the video picture, so no extraction command can find them, because they are not a track. If identify shows no subtitle tracks yet you see text on screen, you have hardcoded subtitles. The only route is OCR on the video frames, and Subtitle Edit and some dedicated tools offer it.

Troubleshooting: Errors and Fixes

Work down this list when something fails. Each item gives the symptom, the cause and the fix.

  1. Command not found for mkvextract or ffmpeg. The program is not on your PATH. Add its folder to PATH, restart the terminal, or call the tool by full path. On Windows that is often C:\Program Files\MKVToolNix.
  2. The file could not be opened. A path with spaces or special characters is unquoted. Wrap the path in double quotes, or move the file to a short folder to rule it out.
  3. Extracted .srt is empty or only a few lines long. You chose a forced track or an empty track. List the tracks again and pick the full one in the same language.
  4. FFmpeg says subtitle encoding is only possible from text to text or bitmap to bitmap. You asked it to turn PGS or VobSub into SRT. Extract with mkvextract and OCR in Subtitle Edit instead.
  5. The .sup file looks like random characters. That is expected. It holds images. Open it in Subtitle Edit for OCR, or play it back in a player that supports Blu-ray subtitles.
  6. Accented letters show as odd symbols. The player assumes a legacy encoding. Set the player to UTF-8 or convert deliberately with iconv.
  7. Subtitles are out of sync. Check for a constant offset or a growing drift, then shift with -itsoffset or Subtitle Edit’s Adjust all times. A growing drift points to a frame rate mismatch and needs point sync.
  8. The ASS file shows wrong fonts or misplaced text in another player. The fonts are stored as MKV attachments. Extract them with mkvextract movie.mkv attachments and install them.
  9. OCR output is full of wrong letters. The OCR language is wrong, or the track is low contrast. Pick the right language, run Fix common errors, and read the file against the video.
  10. The installer will not run on an old Windows. The current MKVToolNix 104.0 supports Windows 10 and Windows Server 2016 and newer, per the official downloads page. Older Windows needs an older MKVToolNix release.
  11. The Ubuntu package is far behind. The project’s repositories stop at 88.0 for Ubuntu 22.04 and 81.0 for 20.04. Upgrade the OS, use the AppImage on a system with glibc 2.28 or later, or build from source.
  12. The VobSub file will not open. The .idx and .sub files got separated. Keep both together in one folder with the same base name.

Advanced Tips for Cleaner Subtitle Workflows

Once extraction is routine, a few moves save time on bigger projects. These all use the same tools.

Fix Track Flags Without Remuxing

If a track has the wrong language or a missing forced flag, edit the header in place with mkvpropedit. It changes metadata without rewriting the video, so it finishes in a second. Back up the file first, because it edits the original.

mkvpropedit movie.mkv --edit track:s1 --set language=eng --set flag-forced=0
mkvpropedit movie.mkv --edit track:s2 --set name="English (SDH)"

Add a Corrected Subtitle Back

After you fix a typo in an SRT, mux it back as a new track. The command copies the original streams and adds your file with a language and a name. Use a new output filename, so the source stays intact.

mkvmerge -o movie.fixed.mkv movie.mkv --language 0:eng --track-name 0:"English (fixed)" movie.eng.srt

Burn Subtitles Into the Picture for Platforms That Ignore Tracks

Some social platforms strip subtitle tracks on upload. When captions must appear on screen, burn them in. FFmpeg’s subtitles filter reads a subtitle file or a stream from the MKV and draws it onto the frames. Styled ASS needs an FFmpeg build with libass, and the video gets re-encoded, so use burn-in as a last step.

# burn the first subtitle stream of the MKV into an MP4
ffmpeg -hide_banner -i movie.mkv -vf "subtitles=movie.mkv:si=0" -c:v libx264 -crf 20 -c:a copy movie.burned.mp4

# burn an external SRT you corrected
ffmpeg -hide_banner -i movie.mkv -vf "subtitles=movie.eng.srt" -c:v libx264 -crf 20 -c:a copy movie.burned.mp4

A burned-in subtitle can never be turned off, and you lose the ability to extract it again later. Keep the clean MKV as your master and treat the burned MP4 as a delivery copy. Subtitle tracks themselves weigh very little, so removing them will not shrink a file. For that goal, see our guide to reducing video file size.

Read Track Data With jq

If you prefer shell tools to Python, pipe the JSON from mkvmerge -J through jq to list only the subtitle tracks with their IDs, languages and codecs. This gives you a quick audit of a whole folder before you extract anything.

for f in *.mkv
do
  echo "$f"
  mkvmerge -J "$f" | jq -r '.tracks[] | select(.type=="subtitles") | "  id=\(.id) lang=\(.properties.language) codec=\(.properties.codec_id) forced=\(.properties.forced_track)"'
done

Two final habits keep a subtitle library tidy. Name files with the language code before the extension so media servers pick them up. And keep the original extracted file untouched, doing your edits on a copy. If an OCR cleanup goes wrong, you can always start again from the raw extraction in seconds.

Common questions

What is the fastest way to extract subtitles from an MKV file?

Run mkvmerge --identify to find the subtitle track ID, then mkvextract file.mkv tracks ID:output.srt. For text tracks, that takes a few seconds even on a long film, because the tool copies the track instead of decoding the video. Both programs are free.

Can I extract subtitles from an MKV with VLC?

VLC plays embedded subtitle tracks and lets you pick one, but it has no simple button for saving a track as a separate file. Use mkvextract or FFmpeg for that. Use VLC afterwards to check sync on the extracted file.

How do I convert PGS subtitles to SRT?

Extract the track as a .sup file with mkvextract, open it in Subtitle Edit, run OCR with the right language, correct the flagged words and save as SubRip. FFmpeg cannot do this step, because PGS is a bitmap format and FFmpeg only converts text to text.

Why does the extracted SRT look plain compared to the original?

The source track was probably ASS, which carries fonts, colors and positions that SRT cannot store. Extract the ASS file itself to keep the styling, and convert to SRT only for tools that demand it.

Does extracting subtitles change my MKV file?

No. Extraction only reads the container and writes new files beside it. The original stays as it was. Header edits with mkvpropedit are the exception, since that tool changes the file in place, so back up first.

Is it legal to extract subtitles from a movie file?

Extracting from your own recordings and files you own is routine. Subtitle text is still a copyrighted work, so check the rules where you live before sharing or redistributing subtitles taken from commercial releases. This is general information, not legal advice.

Can I extract subtitles from MP4 the same way?

Often yes, with FFmpeg. An MP4 with a text track, usually stored as mov_text, converts with ffmpeg -i in.mp4 -map 0:s:0 out.srt. MKVToolNix only reads Matroska files for extraction, so mkvextract is not an option there.

What if the MKV shows no subtitle tracks at all?

Either the file never had subtitles, or they are hardcoded into the picture. Identify the file again and check the output for subtitle lines. If none appear and you still see text on screen, the text is burned in, and only OCR on the video frames can recover it.

More from the Vipid blog

Make it with Vipid

Jonah Reyes

Editing & Export Editor · Vipid Team

Jonah Reyes is the Editing & Export Editor at Vipid. He covers editing software, export settings and codecs, and the video specs of YouTube, Shorts, TikTok and Reels, plus OBS and screen recording. He builds Vipid’s spec tables from the platforms’ own documentation and re-checks them every 60 to 90 days, so the numbers in a guide match what the upload dialog actually accepts.

All articles by Jonah Reyes ›   How we check tools ›

Keep reading

MOV to WAV: Which Converter Gets the Cleanest Audio?
Export & Codecs

MOV to WAV: Which Converter Gets the Cleanest Audio?

Jonah Reyes·1 Dec 2026
MPEG to MP4 Converters Ranked: HandBrake to CloudConvert
Export & Codecs

MPEG to MP4 Converters Ranked: HandBrake to CloudConvert

Jonah Reyes·30 Nov 2026
Edit Mp4
Export & Codecs

Edit Mp4

Jonah Reyes·30 Nov 2026

Blog

Intros & Templates
Titles & Motion
Streaming
Editing & Export
AI Video

Vipid

About Vipid
Themes
News archive 2011–2016
Vipid Team

Editorial

Editorial policy
How we check tools
Corrections

Legal

Privacy policy
Terms of service
Making video intros since 2010.
The Vipid blog covers the tools behind them.