MKVToolNix PGS Extraction Guide

How to Extract PGS Subtitles from MKV with MKVToolNix

MKVToolNix can inspect an MKV file and extract an embedded PGS subtitle track without re-encoding it. Use mkvmerge to find the track whose Codec ID is S_HDMV/PGS, then use mkvextract to save that track as a standalone .sup file. Because PGS subtitles contain images rather than editable text, OCR is still required to create an SRT file.

Run mkvmerge -J input.mkv and locate the subtitle track whose codec_id is S_HDMV/PGS. Note its MKVToolNix track ID, then extract it with:

mkvextract input.mkv tracks 2:output.sup

Replace 2 with the actual track ID from your file.

Next step: Convert the extracted SUP file

MKVToolNix extracts the PGS subtitle stream but does not perform OCR. Upload output.sup to recognize the subtitle images and create an editable SRT file.

Convert your SUP file to SRT

What MKVToolNix Does. Extraction, Not OCR Conversion

ComponentRole in this workflow
MKVToolNix GUIInspects or remultiplexes Matroska files. It is not the documented method for exporting a standalone SUP file.
mkvmergeIdentifies tracks and returns track IDs, codec information, language tags and flags.
mkvextractExtracts a selected track from the MKV into an appropriate standalone file.
Homepage converterRuns the OCR based conversion needed to turn image based SUP/PGS subtitles into SRT text.

An MKV file is a container that can hold video, audio, subtitles, chapters and attachments. PGS is an image based subtitle format commonly associated with Blu-ray sources. If you want the format background first, read how PGS subtitles work.

Extraction removes the selected stream from the container without recognizing subtitle text. OCR is a separate process that interprets the subtitle images and generates text and SRT cues.

Before You Extract the PGS Track

  • The source must be an accessible Matroska file, normally .mkv.
  • MKVToolNix must be installed from its official site or a trusted package source.
  • The file must actually contain a PGS track.
  • You need permission to work with the media and subtitle file.
  • There must be enough free storage for the extracted SUP file.
  • Paths containing spaces must be quoted.

Use the official site to download MKVToolNix from the official website. Windows users can run the bundled command-line utilities from the installation folder or add that folder to PATH. macOS and Linux users can use the official packages or the package option documented for their platform.

mkvextract --version
mkvmerge --version

These commands verify that the utilities are available in the terminal you are using. The executable is not automatically available in every terminal after every installation method.

PGS Extraction Workflow with MKVToolNix

  1. Inspect the MKV with mkvmerge -J or mkvmerge --identify.
  2. Find the subtitle track with Codec ID S_HDMV/PGS.
  3. Confirm its language, name and flags when multiple PGS tracks exist.
  4. Note the MKVToolNix track ID.
  5. Run mkvextract using that ID.
  6. Confirm that the .sup output exists and is not empty.
  7. Convert the extracted SUP file to SRT through OCR.
  8. Review names, punctuation, timing and formatting in the resulting SRT.

For Blu-ray, MakeMKV, HandBrake or multi-tool extraction paths, use the complete SUP/PGS extraction guide.

Step 1. Find the PGS Track ID with mkvmerge

Use JSON identification

mkvmerge -J input.mkv

The long form is:

mkvmerge --identification-format json --identify input.mkv

JSON is recommended because it exposes track objects consistently. Each track has an id, type, codec information and properties. It is easier to inspect or parse than localized human-readable output. The official mkvmerge documentation describes identification output and related options.

Find a track where type is subtitles and properties.codec_id is S_HDMV/PGS. This shortened JSON is only an example:

{
  "id": 2,
  "type": "subtitles",
  "codec": "HDMV PGS",
  "properties": {
    "codec_id": "S_HDMV/PGS",
    "language": "eng",
    "track_name": "English PGS"
  }
}

In this example, the MKVToolNix track ID is 2. Do not copy that number blindly. Use the ID shown for the PGS track in your own file.

Use human-readable identification

mkvmerge --identify input.mkv

Illustrative output can look like this:

Track ID 0: video (HEVC/H.265)
Track ID 1: audio (DTS)
Track ID 2: subtitles (HDMV PGS)

Actual output varies with the source and tool version. Use the track ID associated with the PGS subtitle track. Use the ID shown by mkvmerge, even when that ID is 0.

What to inspect when several PGS tracks exist

FieldWhy it matters
Track IDThe ID reported by mkvmerge and passed to mkvextract.
Codec IDS_HDMV/PGS confirms the PGS subtitle format.
LanguageHelps distinguish English, Spanish and other tracks. Metadata can be missing or incorrect.
Track nameMay identify full subtitles, signs and songs, commentary or forced subtitles.
Default flagIndicates a playback preference, not necessarily the track you want.
Forced flagMay identify dialogue intended to appear only for selected foreign-language passages. Verify rather than assuming.

Important: Metadata is useful but not infallible. If language, track name or forced flags are missing or incorrect, extract plausible tracks separately and inspect or convert them before deciding which one to keep.

MKVToolNix Track IDs Are Not FFmpeg Stream Indexes

mkvmerge --identify and mkvmerge -J report the MKVToolNix track IDs. mkvextract expects those same IDs in its tracks specification. FFmpeg may display absolute stream indexes such as 0:3 or relative subtitle selectors such as 0:s:1.

The numbers can sometimes look similar by coincidence, but users must not assume they are interchangeable. If you prefer the FFmpeg workflow, use FFmpeg stream selectors instead.

Important: Get the track ID from mkvmerge -J input.mkv or mkvmerge --identify input.mkv before using mkvextract. Do not copy an FFmpeg stream index into an mkvextract command unless you independently confirm that it matches the MKVToolNix track ID.

Step 2. Extract the PGS Track as a SUP File

mkvextract input.mkv tracks 2:output.sup
Command partMeaning
mkvextractThe MKVToolNix extraction utility.
input.mkvThe source Matroska file.
tracksTells mkvextract to extract one or more tracks.
2Example MKVToolNix track ID. Replace it with the PGS track ID reported by mkvmerge; valid IDs can include 0.
output.supDestination filename for the extracted PGS stream.

The .sup extension is appropriate for a Blu-ray PGS track extracted from an MKV. This operation does not OCR the images and does not create SRT. See the official mkvextract documentation for the extraction utility syntax.

Paths with spaces

mkvextract "Movie File.mkv" tracks 2:"English Subtitles.sup"

Quoting paths prevents the shell from splitting a filename at spaces.

Absolute paths

Windows PowerShell example:

mkvextract "C:\Videos\Movie.mkv" tracks 2:"C:\Videos\Movie.en.sup"

macOS or Linux example:

mkvextract "/home/user/Videos/Movie.mkv" tracks 2:"/home/user/Videos/Movie.en.sup"

These are examples only. Do not assume those directories exist on every system.

Extracting more than one PGS track

mkvextract input.mkv tracks 2:english.sup 4:spanish.sup

Each trackID:outputFile pair identifies one extraction. Give each output a unique filename, confirm each ID from mkvmerge first, and use this approach when the file includes multiple languages or a full and forced track.

A safe batch script must inspect each input file, select a matching PGS track and create a unique output path. A robust batch implementation is beyond this page's core workflow because track IDs can differ between files.

Extract PGS with MKVToolNix on Windows

  1. Install MKVToolNix from the official download page.
  2. Open PowerShell or Windows Terminal.
  3. Change to the directory containing the MKV or use absolute paths.
  4. Verify mkvmerge and mkvextract are available.
  5. Identify the PGS track.
  6. Extract it using its actual track ID.
  7. Verify the SUP output.
mkvmerge --version
mkvextract --version
mkvmerge -J "C:\Videos\Movie.mkv"
mkvextract "C:\Videos\Movie.mkv" tracks 2:"C:\Videos\Movie.en.sup"

If PowerShell reports that mkvextract is not recognized, the MKVToolNix installation directory may not be in PATH. Run the executable from its installed directory or provide the full path to mkvextract.exe. Do not guess a universal installation path because users can choose a different location.

& "C:\Program Files\MKVToolNix\mkvextract.exe" "C:\Videos\Movie.mkv" tracks 2:"C:\Videos\Movie.en.sup"

The PowerShell call operator & runs an executable whose path is quoted.

Extract PGS with MKVToolNix on macOS or Linux

  1. Install a current MKVToolNix build through an option documented for the operating system.
  2. Open Terminal.
  3. Verify the utilities are available.
  4. Inspect the MKV.
  5. Extract the actual PGS track ID.
mkvmerge --version
mkvextract --version
mkvmerge -J "/path/to/Movie.mkv"
mkvextract "/path/to/Movie.mkv" tracks 2:"/path/to/Movie.en.sup"

Installation commands age and differ by distribution, so use the official download page for current platform instructions.

Why Start Multiplexing Creates Another MKV Instead of SUP

MKVToolNix GUI's multiplexer combines selected video, audio, subtitle and metadata tracks into a Matroska output. Clicking Start multiplexing normally creates another MKV or Matroska container. It does not perform the standalone PGS-to-SUP extraction described here.

To save one embedded PGS track as its own .sup file, identify the track with mkvmerge and extract it with mkvextract.

ActionTool or interfaceResult
Multiplex selected tracksMKVToolNix GUI multiplexer or mkvmergeA Matroska container such as MKV.
Extract one embedded trackmkvextractA standalone file appropriate to that track, such as SUP for PGS.
Recognize PGS subtitle imagesOCR converterText subtitle output such as SRT.

Step 3. Check the Extracted SUP File

  • Confirm the command completed without a fatal error.
  • Confirm the destination file exists.
  • Confirm it is not zero bytes.
  • Use a descriptive filename containing the language or track purpose.
  • If several plausible tracks existed, keep the outputs separate until they are inspected.
  • Review conversion output because the extracted PGS stream contains images, not text.

File size only confirms that data was written. It does not prove that the correct language or track was selected.

Windows PowerShell:

Get-Item "C:\Videos\Movie.en.sup"

macOS or Linux:

ls -lh "/path/to/Movie.en.sup"

Step 4. Convert the Extracted SUP File to SRT

After extraction, the SUP file still contains PGS subtitle images. Creating SRT requires OCR to recognize the visible characters and rebuild them as timed text cues. Open the SUP to SRT converter, upload the extracted .sup file, choose the correct subtitle language and review the generated SRT before using it.

  • Verify names and uncommon words.
  • Check punctuation and line breaks.
  • Confirm italic or positioning cues if they matter.
  • Test timing against the video.
  • Correct recognition errors caused by stylized fonts, low contrast or overlapping graphics.

For media-server placement after OCR, use the Plex subtitle guide or the Jellyfin subtitle guide.

Convert the extracted SUP file to SRT

How to Choose Between Full and Forced PGS Tracks

A full subtitle track may cover most or all dialogue. A forced track may cover only selected dialogue, signs or foreign-language passages. Some files store forced captions in a separate track, while other files may use flags or internal display behavior differently.

  1. Compare language, track name, default flag and forced flag in mkvmerge -J output.
  2. If two tracks remain plausible, extract each to a different SUP filename.
  3. Convert or inspect both.
  4. Keep the one matching the desired content.

Do not assume the smallest track is definitely forced. It can be a clue, not proof.

Troubleshooting MKVToolNix PGS Extraction

mkvextract is not recognized or command not found

MKVToolNix may not be installed, the installation folder may not be in PATH, the terminal may have been opened before the PATH change, or the command may be running from the wrong environment. Verify the installation, reopen the terminal after PATH changes and use mkvextract --version.

No S_HDMV/PGS track appears

The MKV may contain SubRip/SRT, ASS/SSA, VobSub/DVD image subtitles, no subtitle track, or incomplete metadata. Do not rename an unrelated subtitle format to .sup. Extract it using an extension and workflow appropriate for its actual codec.

The extracted file is empty

Check the selected track ID, read access to the input, write access to the destination directory, available disk space, source integrity and the command's warning and error messages.

The wrong language was extracted

Inspect language and track_name properties. Language tags can be absent or wrong, so extract plausible tracks separately when metadata is unclear and use unique output names.

Another MKV was created instead of SUP

You probably used the multiplexer rather than mkvextract. Identify the PGS track with mkvmerge, then use mkvextract input.mkv tracks ID:output.sup.

The output is SUP, not SRT

This is expected. Extraction preserves the image based PGS stream. Use the homepage converter for OCR.

The track number from FFmpeg fails

FFmpeg stream indexes and MKVToolNix track IDs belong to different identification systems. Get the ID from mkvmerge for use with mkvextract.

Permission denied or cannot open output file

Choose a directory you can write to, confirm the output is not locked by another application, quote paths with spaces and avoid unnecessarily running the terminal as administrator or root.

File already exists

Choose a different output filename or deliberately move or rename the existing file first.

OCR result contains errors

Extraction and OCR are separate. The SUP can be extracted correctly while OCR still misreads stylized characters. Choose the correct language and manually review the resulting SRT.

MKVToolNix or FFmpeg. Which Should You Use?

NeedMKVToolNixFFmpeg
Inspect Matroska track IDs and propertiesStrong fit through mkvmerge -J.Can inspect streams with FFprobe or FFmpeg.
Extract a Matroska PGS trackUse mkvextract.Use subtitle stream mapping with stream copy.
Work only with MKV/MatroskaPurpose-built option.Also works, but is a broader multimedia framework.
Perform OCR from PGS to SRTNo.No.
Create editable SRT from PGS imagesRequires a separate OCR converter.Requires a separate OCR converter.

Both tools are useful extraction methods. If you want the alternative command-line workflow, read how to extract PGS subtitles with FFmpeg.

Related SUP and PGS Guides

Browse all subtitle extraction and conversion guides.

Frequently Asked Questions

Can MKVToolNix convert PGS directly to SRT?

No. MKVToolNix can identify and extract the PGS track from an MKV, commonly as a SUP file. PGS stores subtitle images, so converting it to editable SRT text requires a separate OCR step.

What command extracts PGS subtitles from an MKV?

First identify the MKVToolNix track ID with mkvmerge -J input.mkv. Then use mkvextract input.mkv tracks ID:output.sup, replacing ID with the PGS track ID reported for your file.

How do I know which track is PGS?

Inspect the file with mkvmerge -J. Look for a track whose type is subtitles and whose Matroska Codec ID is S_HDMV/PGS. Review its language, name and flags if the file contains several PGS tracks.

Is the track ID always 2?

No. 2 is only a command example. Track IDs are the IDs reported by mkvmerge --identify or mkvmerge -J for that file, and valid IDs can include 0.

Can I use an FFmpeg stream index with mkvextract?

Do not assume so. FFmpeg stream indexes and MKVToolNix track IDs are different identifiers. Obtain the ID from mkvmerge --identify or mkvmerge -J when running mkvextract.

Why did MKVToolNix create another MKV?

You probably used the multiplexer. Multiplexing creates a Matroska container. To export a single PGS track as SUP, use the mkvextract utility included with MKVToolNix.

Does extracting PGS reduce its quality?

Track extraction copies the embedded subtitle stream into a standalone file rather than OCRing or visually recreating it. The later OCR stage can still introduce text-recognition errors, which is why the SRT should be reviewed.

Can I extract more than one subtitle track?

Yes. Add multiple trackID:outputFile specifications to the mkvextract command and give every track a unique output filename. Confirm each ID before running the command.

What does S_HDMV/PGS mean?

It is the Matroska Codec ID used for Blu-ray PGS image based subtitle tracks. It helps distinguish PGS from text subtitles and other bitmap subtitle formats.

Is SUP the same as SRT?

No. A SUP file from this workflow contains PGS subtitle images and timing data. SRT contains editable timed text. Moving from SUP to SRT requires OCR.

Can MKVToolNix extract forced subtitles?

It can extract a selected PGS track that contains forced subtitles. Use track name, language and forced-flag metadata as clues, but verify the result because source metadata is not always reliable.

Finished extracting the PGS track?

Upload the resulting SUP file to convert its image based subtitles into editable SRT text with OCR.

Convert SUP to SRT