Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Created February 10, 2018 22:28
Show Gist options
  • Save peteristhegreat/9a642f3cdf2870b038c8e83bd933091d to your computer and use it in GitHub Desktop.
Save peteristhegreat/9a642f3cdf2870b038c8e83bd933091d to your computer and use it in GitHub Desktop.
MKV to SRT

https://forum.videohelp.com/threads/333581-How-to-extract-srt-from-mkv-file

SRT are text based sub. idx/sub are image based subs , so you need to OCR - which isn't always accurate (lot of manual checking and fixing) . Even if you used an "automatic" program you would still have to go back and check for errors To avoid manual work and error checking, downloading the srt that someone has already done the work for is usually the easiest option

If we are talking English subs what I've found works best is extract the PGS sub using MkvExtractGui-2. Load it in BDSup2Sub. Change the resolution to 720x480 NTSC. Export as ifo/sup. Load the .sup and .ifo file in DVDSubEdit. Use the automatic OCR. Export to .srt. Not always perfect but it's the easiest I've found. Usually if you search for an underscore character('_') and don't find any, then the OCR went smoothly. The question I would ask is why does it have to be .srt? Many software players, set top boxes and DVD players will handle external idx/sub files. Just wondering why it has to be .srt.

The first link from google takes you to a not so great "use our trial software" and then pay 10$ per month stuff. With an okay tutorial on how to use MKVExtractGUI.

Freeware only on Windows

Install the following programs:

https://www.videohelp.com/software/DVDSubEdit https://www.videohelp.com/software/BDSup2Sub

https://sourceforge.net/projects/mkvextractgui-2/ https://mkvtoolnix.download/ -> https://www.fosshub.com/MKVToolNix.html

  1. Open MKVExtractGUI. Open your MKV file and extract any subtitle tracks you want: This dumps different files... If it is a SRT file, all done! If it is a SUB with an IDX file keep reading.
  2. Open the SUB/IDX in BDSup2Sub512.jar . File > Load the SRT file. Change the output format to SUP/IFO. File > Export the SUP/IFO file.
  3. Open the SUP file (followed by the IFO file) in DVDSubEdit. Click Run OCR in the bottom right. Then click Save as .srt.
  4. Inspect the SRT file for underscores to see if there were any hicups with the OCR.

Done.

PlexTranscoder

I haven't tried it yet, but it looks like it can be done quickly with the tools in Plex, too. This is also mentioned in the first link above.

PlexTranscoder - i input_file.mkv -map 0:s:0 -c copy subtitle_file.ext

or

PlexTranscoder - i input_file.mkv -map 0:s:0 -c subrip ./output_file.srt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment