extract subtitles from mkv

Download mkvtoolnix from:

https://mkvtoolnix.download/downloads.html

You can use mkvmerge (from mkvtoolnix) to inspect the file to see what the ID of the subtitles data will be:

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 is the one you identified above. You can use any srt filename that you want.

mkvextract tracks input.mkv :.srt

So, in our case, that would have been:

mkvextract tracks input.mkv 3:subs.srt