SubRip

SubRip

Infobox file format
name = SubRip
icon =



caption =
extension = .srt
mime =
type code =
uniform type =
magic =
owner =
genre =
container for =
contained by =
extended from =
extended to =
standard =
"'

SubRip is an optical character recognition program for Windows which rips (extracts) subtitles and their timings from video files or DVDs, recording them as a text file. "Subrip" is also the name of the subtitle format created by this software. The caption files are named with the extension .SRT. This format is supported by most software video players and subtitle creation programs, detailed in the article Comparison of media players.

In practice, SubRip is first configured to correctly detect subtitles in a video file. The correct video codecs (DGMPGDec for DVDs) must be installed, along with AviSynth. SubRip is configured while displaying a frame with subtitles, including their color, shape of the subtitle area, and any required image manipulation (fattening, contrast adjustments). After trial and fine tuning, extraction is then performed automatically for the entire file during playback.

The time format used is hours:minutes:seconds,milliseconds, with the seconds field precise to three decimal places. The decimal separator used is the comma, since the program was written in France, and the line break used is the CR+LF pair. Subtitles are indexed numerically, starting at 1.

Versions

SubRip was written by French programmer "Brain" (& Dub), starting in 1999. On March 3, 2000 the first version, SubRip 0.5 beta, was released — as all the consecutive versions declared as Beta. His last version was SubRip 0.97 beta — published September 8, 2001. Afterwards he stopped development, and upon receiving several requests for Linux support Brain released the SubRip source code under the GPL licence. SubRip is coded with Delphi 5. The original website is now offline, but a copy is viewable at the Internet Archive.

Only seven weeks later "T.V. Zuggy" and "Guimli" released their first own version of the program — SubRip 0.98 — that was also acknowledged on Brain's site. For the SubRip 1.50 Beta 3 release (on January 5, 2006) code has been moved to Delphi 2005 (after a time with Delphi 7). The latest version is 1.50 beta 4. Programming is now mostly done by "ai4spam" who announced in October 2006 that he is going to abandon it after releasing one more beta.

Fields

:"Subtitle number" "Start time" "-->" "End time" "X1:Position left" "X2:Position right" "Y1:Position up" "Y2:Position down" "Text of subtitle (one or more lines)" "Blank line"

Display coordinates are optional [ [http://forum.doom9.org/showthread.php?p=470941#post470941 Formal SRT format specification] ] and they aren't handled correctly by most current players [ [http://ale5000.altervista.org/subtitles.htm Comparison table of SRT capabilities of players] ]

Unicode and basic HTML tags such as , and in subtitles are supported by most players, but VLC and some subtitle editors (SubResync, Subtitle Workshop) do not handle these tags well.

Note that SubRip is hard to port to Linux because of the language it's written in Delphi. That being said, SubRip works perfectly well on Linux with Wine.

Whoever is looking to implement most of the official and unofficial tags that may exist in a SRT file, should inspect the [http://ale5000.altervista.org/subtitles.htm#a SubRip subtitles capability tester by ale5000]

ample file

100:00:20,000 --> 00:00:24,400In connection with a dramatic increasein crime in certain neighbourhoods,

200:00:24,600 --> 00:00:27,800The government is implementing a new policy...

MPlayer tolerates missing index lines as in the example below:

00:00:00,000 --> 00:00:00,999I know this..

00:00:01,000 --> 00:00:01,999It's a unix system!

With optional display coordinates

100:00:20,000 --> 00:00:24,400 X1:100 X2:600 Y1:050 Y2:100In connection with a dramatic increasein crime in certain neighbourhoods,

200:00:24,600 --> 00:00:27,800The government is implementing a new policy...

Conversion

Here is an exemplary python-script "srt2sub.py" which converts subtitles from the SubRip .srt format into the MicroDVD .sub format.

import sys,string,re

framerate = 23.956

if(len(sys.argv)<2): print 'usage: %s input'%(sys.argv [0] ) sys.exit(0)

name = sys.argv [1] if name [-4:] = '.srt': name = name [:-4] infile = '%s.srt'%(name)outfile = '%s.sub'%(name)

fin = open(infile,'r')fout = open(outfile,'w')subtitle_count = 1read_mode = 0read_buffer = [] html_re = re.compile(r'<.*?>')for line in fin: line = line.strip() if (read_mode = 0) and (string.find(line,str(subtitle_count)) >=0 ): read_mode = 1 continue if (read_mode = 1): starttime = 60*60*int(line [:2] ) + 60*int(line [3:5] ) + int(line [6:8] ) + int(line [9:12] )/1000.0 stoptime = 60*60*int(line [17:2+17] ) + 60*int(line [3+17:5+17] ) + int(line [6+17:8+17] ) + int(line [9+17:12+17] )/1000.0 read_mode = 2 continue if (read_mode = 2): if (line = "): read_mode = 0 write_str = '{%d}{%d}%s%s'%(starttime*framerate,stoptime*framerate,'|'.join(read_buffer),' ') write_str = html_re.sub(",write_str) fout.write(write_str) read_buffer = [] subtitle_count += 1 continue read_buffer += [line] fin.close()fout.close()

References

ee also

*Universal Subtitle Format
*SubStation Alpha

External links

* [http://membres.lycos.fr/subrip/ Original site] .
* [http://forum.doom9.org/showthread.php?t=93680 SubRip forum (Doom9)]
* [http://www.afterdawn.com/guides/archive/rip_subtitles_with_subrip.cfm SubRip Tutorial (AfterDawn)]
* [http://ale5000.altervista.org/subtitles.htm SubRip subtitles support in players]


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • SubRip — Desarrollador Brain[1] T.V. Zuggy[2] www …   Wikipedia Español

  • SubRip — est un logiciel de reconnaissance de caractères pour Windows qui extrait les sous titres et leur synchronisation de vidéos ou de DVD. Il les enregistre au sein d un simple fichier texte. Subrip est aussi le nom du format de fichier associé à ce… …   Wikipédia en Français

  • Subtítulo — Este artículo o sección necesita una revisión de ortografía y gramática. Puedes colaborar editándolo (lee aquí sugerencias para mejorar tu ortografía). Cuando se haya corregido, borra este aviso por favor. Un subtítulo es un texto que aparece en… …   Wikipedia Español

  • Computer-assisted translation — Part of a series on Translation Types Language interpretation …   Wikipedia

  • SubViewer — Тип Создание и редактирование субтитров Автор Дэвид Долинский Написана на .Net C# 3.5 Языки интерфейса English Первый выпуск 1999 (1999) Аппаратная платформа …   Википедия

  • Comparison of video player software — This article is about video player software. For a comparison of audio player software, see Comparison of audio player software. For a comparison of hardware device type portable media players, see Comparison of portable media players. The… …   Wikipedia

  • DivX — This article is about the video codec. See DivX, Inc. for the company behind the codec. For the former videodisc format, see DIVX. Series of articles on DivX …   Wikipedia

  • Subtitle (captioning) — For other uses, see Subtitle. Part of a series on Translation Types …   Wikipedia

  • Comparaison De Lecteurs Multimédia — Les tableaux suivants comparent les informations générales et techniques de certains lecteurs multimédia. Pour des informations plus précises sur un lecteur, il est préférable de consulter son propre article. Sommaire 1 Général 2 Systèmes d… …   Wikipédia en Français

  • Comparaison de lecteurs multimedia — Comparaison de lecteurs multimédia Les tableaux suivants comparent les informations générales et techniques de certains lecteurs multimédia. Pour des informations plus précises sur un lecteur, il est préférable de consulter son propre article.… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”