Wednesday, June 11, 2014

Create subtitles with srt-files

Subtitles are quite useful when you're watching a movie in a foreign language. Of course you can create your own *.srt-files to include them into your video. Let's see how that works.

At first, you simply need an editor. You can use the in Windows-included Notepad or something better like Notepad++.
In the latter it's much easier, because the important things are colored (if you chose XML as the language) and you can also see the line numbers.

To create one subtitle line you need three rows: The first is always the counter, so start with '1'. The second contains the time from the begin of the sub until it disappears.

You have to use the following syntax: hh:mm:ss,000 ==> hh:mm:sss,000

In the last line you have to write the text. With HTML codes you change font color, size and so on. As you can see in this example:

1
00:01:03.030 ==> 00:01:06.078
<font size="32px" color="white">This is a test subtitle!</font>
In the following you can see how helpful Notepad++ is:
Example for srt file opened in Notepad++
To make some adjustments it could be very useful to test the file within the VLC media player. Just open the suited video, right-click in the video, select 'subtitle' and then 'Open File'.
How to open a subtitle file in VLC media player
Then just chose the file you've previously created and watch if everything matches fine. Else, you can always make some adaptions - maybe you have to change a line for a tenth of a second up or down.

If everything matches fine you can create mkv-files. In these files you can include subtitles into the video file. All you need is the application 'mkvmerge':
How to add sub titles into mkv files
Mkvmerge can create new mkv-files with additional audio dubs and subs. To begin you just need to press the 'add' button to select your video file and your srt file. 

In the segment with 'track, chapters and tags' you can see then the video file, the audio file from the video and your imported srt file. If you click at the srt-file (usually named as 'SubRip/SRT ... ) you can give the subtitle line a 'track name' and also chose a language in the 'general track options'.

Finally you just need to select the destination and press 'Start muxing'.

Of course there are also other and easier ways to create subtitles but that's another story...

No comments:

Post a Comment