How to create my own .srt subtitle file format?

a cooperator

Honorable
Aug 7, 2012
49
0
10,580
0
Hi everyone
I have some English films files(some of which are up to 01:25:37). Some friend of mine helped me get all the subtitles(closed captions). Now I am going to prepare the .srt subtitle file format of those video files. I will need to have
the .txt file containing the subtitles as well as timing information.
However, my issue here how to calculate time in comparison to audio in order to let audio be consistent to subtitles while watching/playing a video file.
As far as I know the .srt file format is very simple. Each subtitle is written as follows:
1- | 32
2- | 00:45:01,000 --> 00:45:2,735
3- | How cool!
4- | Let's go!


The first line indicates the order (so this is the 32nd subtitle).
The second line indicates the start and end time of its appearance on the screen.
Time from the start of the video is encoded as a fixed number of digits: hours:minutes:seconds,milliseconds
The actual subtitle follows on any number of lines, terminated by a blank line.


After preparing the .srt, I will use Any Video Converter, and I will add Video file, along with created .srt file, and then I will convert it.
 

a cooperator

Honorable
Aug 7, 2012
49
0
10,580
0



Thanks a lot,
I have downloaded that program mentioned, and I tried using the portable one with 32-bit on my Windows 10 -64-bit-based- OS.
I have some questions:
1- I think it is a very long way encoding different audios and videos.

2- If I have a subtitle which by error is saved as ‘.txt’… all I have to do is open it with windows notepad. then ‘Save as’, and in the first option, change the ‘.txt’ with ‘.srt’. then, on the next option, change ‘text document .txt’, to ‘all files’.
Save and that’s it.
However, If I have a simple text, I need to add every time frame for each subtitle lie, to be shown at the exact moment is required by the video.
Also, it has to fill some requirements to work a a subtitle srt file.
Here’s an example:
I have downloaded a .MKV file without comprising its .srt subtitles file. I tried looking for its subtitles on the internet. However, I only found that subtitles written/typed as comments under video link. But it is exact the same subtitles in comparison to the audio file while listening to Video file. I tried copying and pasting it into a notepad file, and saved it.
That subtitles I found it it looked something like this:
This is just a part of subtitles to only show you how it looks like:
-----------------------------------------------------
00:06- [Voiceover] Welcome to The Effortless English Show
00:08 with the world's number one English teacher, AJ Hoge,
00:11 where AJ's more than 40 million students worldwide
00:13 finally learn English once and for all
00:16 without the boring textbooks, classrooms
00:18 and grammar drills.
00:19 Here's AJ with a quick piece to help you learn
00:21 to speak fluent English effortlessly.
00:29 -Hello and welcome to The Effortless English Show!
00:32 I am AJ Hoge, the author of Effortless English, this book.
00:38 And this is the show that teaches you
00:40 to speak English powerfully.
00:46 Many years ago, I was sitting
00:51 in Spanish class.
00:53 So I was in university, sitting in my Spanish class,
00:57 another day of Spanish, (sighs) waiting for the teacher.
01:04 And the teacher strolled in, and I'm thinking,
01:08 "Oh God, another, another terrible class of grammar rules
01:13 "and vocabulary lists."
01:16 But on this day something different.
01:21 The teacher was pushing a cart, right, with wheels
01:26 that had a TV on top.
01:29 So, instantly everybody in the class
01:32 kind of sat up more straight and smiled,
01:35 and there was a little bit of energy in the room,
01:38 and we all looked at each other,
01:39 and everybody was happy.
01:41 This positive energy spread around the classroom.
01:45 We all kind of giggled and laughed, and "Ah", "Ooh".
01:48 Because we realized that it was Movie Day.
01:52 Yes!
01:54 No boring grammar rules, no boring vocabulary lists,
01:57 no tests, no quizes - we were gonna watch a movie!
02:00 Yeah!
02:02 Movie Day was always a happy day in school,
02:05 in any class, but especially in Spanish class.
02:10 So the teacher hooked up the TV, plugged it in,
02:14 and, of course, there was a VCR in those days,
02:17 so they used tapes.
------------------------------------------------------------
Step1: I tried saving that .txt file to .srt file after opening it with windows notepad. then ‘Save as’, and in the first option, change the ‘.txt’ with ‘.srt’. then, on the next option, change ‘text document .txt’, to ‘all files’. and I saved it. So, I got .srt file.
Step2: I tried opening that program, and open subtitles, and then select '.srt file' above. However, the Aegisub gave me an error "Error loading file, Parsing SRT: Expected subtitles index at line 1"

Step3, I tried selecting the same subtitles file, but saved as .txt file. Then, the file was opened by Aegisub. (It looks like this screen shot below)



However, I think that format above is not OK for a .srt file. So, I will need to add every time frame for each subtitle lie. HOW TO DO IT? I think it would be a very long way encoding different audios and videos. So, that program wouldn't help much? Will I need to add the video file to Aegisub after adding subtitles file? Then, I will try to edit each subtitles again.
 

a cooperator

Honorable
Aug 7, 2012
49
0
10,580
0



Moreover, while playing a movie file using VLC media player, I tried searching for subtitles using "Using VLSub", with 'search by hash, but I didn't find any results. However, with 'search by name', I found some results, have downloaded .srt subtitles files for some movie files.
For example, I tried downloading the subtitles file for the 'Blindness 2008', in each time, I selected another result. But when adding to the movie file, I found the same delay interval.



However, when adding/uploading some .srt subtitles files to their own movie files, I found there is delay interval between the subtitles shown on screen and audio. The audio of video file is about quarter a minute delayed.
Some other .srt subtitles are consistent to their audio files. (there is no delay interval.)

Why does that happen? Will I need to edit the .srt subtitle file format to be shown consistently with audio?






 

why_wolf

Estimable
Aug 28, 2015
221
0
5,110
59
the forum over at aegisub will probably be best for you conversion problem question. Though from glancing it appears There are several different "kinds" of subtitles, .SRT is by far the best IMO but it is not the default or industry standard. Normally when I make subtitles I rip the video with makemkv, then use MKVextract to pull the subtitle files out of the .MKV file. Then I use an OCR program to convert the image based subtitle to a text based one so I can actually edit them. I use suprip for Blurays and subrip for DVDs. Then finally I use Aegisub to clean up the subtitles (OCR is not 100% correct) and fix any other problems.

As for your timing issue, this will always be a problem for any subtitle file that does not come directly from your version of the video. As tiny changes in different releases of the video as simple as a 3 second black screen in a US version to a 5 second black screen in the UK version will throw every single subtitle line off by a noticeable two seconds. Or worse depending on how different the versions could be.

Now assuming that the actual 'movie' run time is still the same (from whatever the original subtitle source is and your copy) you can use the universal time tool in aegisub to push forward or back all the subtitles to sync back up with the audio/video. Go to Timing>Shift Times and choose forward or backwards to push all the timings around. You can load both the video and audio into Aegisub as well to make accurate timing changes line by line if need be. But generally if you notice its off across the entire video its probably off by a single universal length of time and not random intervals on each individual line.

videohelp is also a good site to use.

Side note: I really don't like those subtitle sites or auto download features of some players for exactly the timing issue you just discovered.
 
Thread starter Similar threads Forum Replies Date
L Streaming Video & TVs 4
R Streaming Video & TVs 0
I Streaming Video & TVs 0
J Streaming Video & TVs 1
R Streaming Video & TVs 0
R Streaming Video & TVs 0
A Streaming Video & TVs 3
M Streaming Video & TVs 1
G Streaming Video & TVs 0
G Streaming Video & TVs 6
M Streaming Video & TVs 9
M Streaming Video & TVs 1
O Streaming Video & TVs 1
G Streaming Video & TVs 0
G Streaming Video & TVs 2
G Streaming Video & TVs 2
G Streaming Video & TVs 1
W Streaming Video & TVs 4
G Streaming Video & TVs 0
G Streaming Video & TVs 0

ASK THE COMMUNITY