<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=SubRip_Subtitles</id>
	<title>SubRip Subtitles - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=SubRip_Subtitles"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=SubRip_Subtitles&amp;action=history"/>
	<updated>2026-04-17T03:07:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=SubRip_Subtitles&amp;diff=4675&amp;oldid=prev</id>
		<title>Kenneth: /* srt format */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=SubRip_Subtitles&amp;diff=4675&amp;oldid=prev"/>
		<updated>2018-05-06T03:03:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;srt format&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== SubRip Subtitles ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;SubRip is a software program for Windows which &amp;quot;rips&amp;quot; (extracts) subtitles and their timings from video. It is free software, released under the GNU GPL. SubRip is also the name of the widely used and broadly compatible subtitle text file format created by this software.&amp;quot; [http://en.wikipedia.org/wiki/SubRip]&lt;br /&gt;
&lt;br /&gt;
== srt format ==&lt;br /&gt;
&lt;br /&gt;
SubRip (SubRip Text) files are named with the extension .srt, and contain formatted lines of plain text in groups separated by a blank line. Subtitles are numbered sequentially, starting at 1. The timecode format used is hours:minutes:seconds,milliseconds with time units fixed to two zero-padded digits and fractions fixed to three zero-padded digits (00:00:00,000). The fractional separator used is the comma, since the program was written in France. The subtitle separator, a blank line, is the double byte MS-DOS CR+LF pair, though the POSIX single byte linefeed is also well supported.&lt;br /&gt;
&lt;br /&gt;
# A numeric counter identifying each sequential subtitle&lt;br /&gt;
# The time that the subtitle should appear on the screen, followed by --&amp;gt; and the time it should disappear&lt;br /&gt;
# Subtitle text itself on one or more lines&lt;br /&gt;
# A blank line containing no text, indicating the end of this subtitle&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* SRT Subtitles | Matroska - http://matroska.org/technical/specs/subtitles/srt.html&lt;br /&gt;
* SubRip - Wikipedia - http://en.wikipedia.org/wiki/SubRip&lt;br /&gt;
* SubRip - http://zuggy.wz.cz/&lt;br /&gt;
&lt;br /&gt;
== SRT Validator ==&lt;br /&gt;
&lt;br /&gt;
Repair my dotSUB SRT - http://www.gorissen.info/Pierre/files/SRT_repair.htm&lt;br /&gt;
&lt;br /&gt;
== Sample ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
00:02:00,829 --&amp;gt; 00:02:02,538&lt;br /&gt;
&amp;lt;font face=&amp;quot;Comic Sans MS&amp;quot;&amp;gt;This is the boss.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
00:02:09,629 --&amp;gt; 00:02:10,629&lt;br /&gt;
&amp;lt;font face=&amp;quot;Comic Sans MS&amp;quot;&amp;gt;Ahhh!&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sample .srt ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
00:00:10,500 --&amp;gt; 00:00:13,000&lt;br /&gt;
Elephant&amp;#039;s Dream&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
00:00:15,000 --&amp;gt; 00:00:18,000&lt;br /&gt;
At the left we can see...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== download srt files ==&lt;br /&gt;
&lt;br /&gt;
* Subtitles - download DivX subtitles from the biggest open subtitles database - http://www.opensubtitles.org/en/search2/sublanguageid-eng/&lt;br /&gt;
&lt;br /&gt;
* Subtitles for - http://subsmax.com/subtitles-movie/&lt;br /&gt;
&lt;br /&gt;
* SubtitleSeeker.com : Seek &amp;amp; Find Subtitles - http://www.subtitleseeker.com&lt;br /&gt;
&lt;br /&gt;
== SubRip Software ==&lt;br /&gt;
&lt;br /&gt;
zuggyWu:d - http://zuggy.wz.cz/&lt;br /&gt;
&lt;br /&gt;
== Adjust Time Script ==&lt;br /&gt;
&lt;br /&gt;
https://github.com/oeey/srtshift&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
SubRip Subtitle (.srt) Time Shift&lt;br /&gt;
&lt;br /&gt;
Description: Sometimes subtitle files are off by a second or two.&lt;br /&gt;
    This will shift all time references forward or backwards&lt;br /&gt;
    by the time specified.&lt;br /&gt;
&lt;br /&gt;
Usage: python srtshift.py &amp;lt;file.srt&amp;gt; &amp;lt;+/-shift_sec&amp;gt; [outfile.srt]&lt;br /&gt;
&lt;br /&gt;
Param 1: srt file name&lt;br /&gt;
Param 2: time to shift in seconds (eg. -1.5 or 2.5)&lt;br /&gt;
Param 3: optional outfile to write to, else output to console&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__author__  = &amp;quot;Kenneth Burgener &amp;lt;kenneth@oeey.com&amp;gt;&amp;quot;&lt;br /&gt;
__date__    = &amp;quot;Feb 02, 2014&amp;quot;&lt;br /&gt;
__version__ = &amp;quot;1.0&amp;quot;&lt;br /&gt;
__license__ = &amp;quot;GPL&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import re&lt;br /&gt;
import decimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def adj_time(adj_seconds, hours, minutes, seconds, milli):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Adjust time points forwards or backwards&lt;br /&gt;
&lt;br /&gt;
    @param adj_seconds (float): seconds to adjust time&lt;br /&gt;
    @param hours (int): time hours&lt;br /&gt;
    @param minutes (int): time minutes&lt;br /&gt;
    @param seconds (int): time seconds&lt;br /&gt;
    @param milli (int): time milliseconds&lt;br /&gt;
&lt;br /&gt;
    Example: adj_time(1.5, 0, 0, 1, 0) -&amp;gt; (0, 0, 2, 500)&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # suffers from floating point issues, use Decimal instead&lt;br /&gt;
    #delta_milli = (abs(adj_seconds) - int(abs(adj_seconds))) * 1000.0 # suffers from floating point&lt;br /&gt;
    decimal.getcontext().prec = 3  # set decimal precision to 3 places&lt;br /&gt;
    delta_milli = int((decimal.Decimal(abs(adj_seconds)) - int(abs(adj_seconds))) * 1000)&lt;br /&gt;
&lt;br /&gt;
    delta_sec = int(abs(adj_seconds))&lt;br /&gt;
    if adj_seconds &amp;gt; 0:&lt;br /&gt;
        milli += delta_milli&lt;br /&gt;
        seconds += delta_sec&lt;br /&gt;
        while milli &amp;gt;= 1000:&lt;br /&gt;
            milli -= 1000&lt;br /&gt;
            seconds += 1&lt;br /&gt;
        while seconds &amp;gt;= 60:&lt;br /&gt;
            seconds -= 60&lt;br /&gt;
            minutes += 1&lt;br /&gt;
        while minutes &amp;gt;= 60:&lt;br /&gt;
            minutes -= 60&lt;br /&gt;
            hours += 1&lt;br /&gt;
    elif adj_seconds &amp;lt; 0:&lt;br /&gt;
        milli -= delta_milli&lt;br /&gt;
        seconds -= delta_sec&lt;br /&gt;
        while milli &amp;lt; 0:&lt;br /&gt;
            milli += 1000&lt;br /&gt;
            seconds -= 1&lt;br /&gt;
        while seconds &amp;lt; 0:&lt;br /&gt;
            seconds += 60&lt;br /&gt;
            minutes -= 1&lt;br /&gt;
        while minutes &amp;lt; 0:&lt;br /&gt;
            minutes += 60&lt;br /&gt;
            hours -= 1&lt;br /&gt;
    if hours &amp;lt; 0:&lt;br /&gt;
        return 0, 0, 0, 0&lt;br /&gt;
    return hours, minutes, seconds, milli&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def run():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot; Process command line parameters and adjust .srt file &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if len(sys.argv) &amp;lt; 3 or len(sys.argv) &amp;gt; 4:&lt;br /&gt;
        print &amp;quot;Usage: python %s &amp;lt;file.srt&amp;gt; &amp;lt;+/-shift_sec&amp;gt; [outfile.srt]&amp;quot; % sys.argv[0]&lt;br /&gt;
        print &amp;quot;Example: python %s movie.srt 1.5 &amp;gt; movie_out.srt&amp;quot; % sys.argv[0]&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&lt;br /&gt;
    infile = sys.argv[1]&lt;br /&gt;
    shift_sec = sys.argv[2]&lt;br /&gt;
&lt;br /&gt;
    if len(sys.argv) == 4:&lt;br /&gt;
        outfile = sys.argv[3]&lt;br /&gt;
        outfile_handle = open(outfile, &amp;#039;w&amp;#039;)&lt;br /&gt;
    else:&lt;br /&gt;
        outfile = None&lt;br /&gt;
&lt;br /&gt;
    with open(infile) as f:&lt;br /&gt;
        for line in f:&lt;br /&gt;
            match = re.findall(&amp;#039;([0-9]+):([0-9]+):([0-9]+),([0-9]+) --&amp;gt; ([0-9]+):([0-9]+):([0-9]+),([0-9]+)&amp;#039;, line)&lt;br /&gt;
            if match:&lt;br /&gt;
                match = match[0]&lt;br /&gt;
                start_hour = int(match[0])&lt;br /&gt;
                start_minutes = int(match[1])&lt;br /&gt;
                start_sec = int(match[2])&lt;br /&gt;
                start_milli = int(match[3])&lt;br /&gt;
                end_hour = int(match[4])&lt;br /&gt;
                end_minutes = int(match[5])&lt;br /&gt;
                end_sec = int(match[6])&lt;br /&gt;
                end_milli = int(match[7])&lt;br /&gt;
&lt;br /&gt;
                start_hour, start_minutes, start_sec, start_milli = \&lt;br /&gt;
                    adj_time(float(shift_sec), start_hour, start_minutes, start_sec, start_milli)&lt;br /&gt;
                end_hour, end_minutes, end_sec, end_milli = \&lt;br /&gt;
                    adj_time(float(shift_sec), end_hour, end_minutes, end_sec, end_milli)&lt;br /&gt;
&lt;br /&gt;
                if outfile:&lt;br /&gt;
                    outfile_handle.write(&amp;quot;{0:02}:{1:02}:{2:02},{3:03} --&amp;gt; {4:02}:{5:02}:{6:02},{7:03}\n&amp;quot;.format(&lt;br /&gt;
                        start_hour, start_minutes, start_sec, start_milli,&lt;br /&gt;
                        end_hour, end_minutes, end_sec, end_milli))&lt;br /&gt;
                else:&lt;br /&gt;
                    print &amp;quot;{0:02}:{1:02}:{2:02},{3:03} --&amp;gt; {4:02}:{5:02}:{6:02},{7:03}&amp;quot;.format(&lt;br /&gt;
                        start_hour, start_minutes, start_sec, start_milli,&lt;br /&gt;
                        end_hour, end_minutes, end_sec, end_milli)&lt;br /&gt;
&lt;br /&gt;
            else:&lt;br /&gt;
                if outfile:&lt;br /&gt;
                    outfile_handle.write(line.strip() + &amp;quot;\n&amp;quot;)&lt;br /&gt;
                else:&lt;br /&gt;
                    print line.strip()&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Pirate]]&lt;br /&gt;
[[Category:DVD]]&lt;br /&gt;
[[Category:Movies]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>