Overview

srtextract - Extract subtitles from MKV files

srtextract extracts subtitles from MKV files under a directory and writes them in order to be compatible with DLNA servers (such as Samsung PC Share manager)

Simulate

If you just want to see what the script would do without actually extracting
things pass in --dry-run
--dry-run combined with logging verbosity will output what actions the script

will do

Example:
subextract ~/Videos rum -l eng --dry-run -vvv

Analyzing /home/user/Videos

Found file /home/user/Videos/video1.mkv Selected subtitle track 1 name rum for video1.mkv Writing /home/user/Videos/video1.srt

Found file /home/user/Videos/video2.mkv Subtitle already exists for /home/user/Videos/video2.mkv

Finished analyzing /home/user/Videos

Overwriting already existing subtitles
Passing in the --overwrite flag will overwrite existing subtitles if a

suitable subtitles is found in the MKV file.

Logging verbosity

Default mode (diff-only)
Will only log newly found subtitles
Verbose mode (-v)
List MKV files that are found, selected subtitles and other actions performed by the script

Language preferences

You can define which language you want extracted from files with the --language

(or -l) parameter.

Example:
subextract /path/to/Videos rum

Will extract only Romanian language subtitles for every MKV file under the path

You can also allow fallback languages:

subextract /path/to/Videos/ rum -l eng

This will attempt to extract Romanian subtitles, but if no Romanian subtitles

are found in a file will attempt to extract and English subtitle

If no suitable subtitles are found, nothing is extracted.

Default language is English (if no other languages are specified).

Compatible languages can be found with mkvmerge --list-languages