Difference between revisions of "Create SRT Subtitles From MKV Files"

From MythTV Official Wiki
Jump to: navigation, search
(Created page with 'Based on a question from a user trying to use the internal MythTV player is display subtitles embedded in MKV files, [[http://www.gossamer-threads.com/lists/mythtv/users/322781#3…')
 
m (mark as outdated)
 
Line 1: Line 1:
 +
{{Outdated2|This task no longer necessary.  SRT subtitles embedded into Matroska containers have been supported by the internal player since the [[Release_Notes_-_0.24#New_Features|0.24 release]]}}
 +
 
Based on a question from a user trying to use the internal MythTV player is display subtitles embedded in MKV files,
 
Based on a question from a user trying to use the internal MythTV player is display subtitles embedded in MKV files,
 
[[http://www.gossamer-threads.com/lists/mythtv/users/322781#322781|robthebob]] suggests the following workaround to extract SRT subtitles from MKV files.
 
[[http://www.gossamer-threads.com/lists/mythtv/users/322781#322781|robthebob]] suggests the following workaround to extract SRT subtitles from MKV files.

Latest revision as of 22:51, 17 October 2011

Time.png Outdated: This task no longer necessary. SRT subtitles embedded into Matroska containers have been supported by the internal player since the 0.24 release

Based on a question from a user trying to use the internal MythTV player is display subtitles embedded in MKV files, [[1]] suggests the following workaround to extract SRT subtitles from MKV files.

$ mkvinfo film.mkv | grep subtitles -B3
| + A track
| + Track number: 3
| + Track UID: 2131733228
| + Track type: subtitles
$ mkvextract tracks film.mkv 3:film.srt

This is necessary because there is no support in MythTV's internal player for embedded subtitles. If you have a number of files in a directory that share the same track number for their subtitles (track 3 in the previous and following examples), you can avoid having to mkvextract each line by using the following bash loop.

for file in *.mkv; 
do 
  mkvextract tracks "$file" 3:"${file/mkv/srt}"; 
done

The package that contains mkvinfo and mkvextract is 'mkvtoolnix' in Ubuntu.