Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
\" dvdsubtitles.1 - the *roff document processor src for the dvdsubtitles manual\"\" This file is part of PointedEars' DVD Subtitles.\" Copyright (C) 2005, 2006 Thomas Lahn <dvd@PointedEars.de>\"\" Permission is granted to copy, distribute and/or modify this document\" under the terms of the GNU Free Documentation License, Version 1.2\" or any later version published by the Free Software Foundation;\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover\" Texts. A copy of the license is available on the Web[1] or\" from the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,\" Boston, MA 02110-1301 USA.\"\" [1] <http://www.gnu.org/licenses/licenses.html#FDL>\"\" You may contact the author by:\" e-mail: dvd@PointedEars.de\" snail mail:\" Thomas Lahn\" Warschauer Strasse 1a/0403\" D-99089 Erfurt\" Federal Republic of Germany.TH dvdsubtitles 1 "2006-02-15" "0.6.1.2006021519" "DVD Tools".SH NAMEdvdsubtitles \- Extract subtitle stream from Video DVD data to text file.SH SYNOPSIS.B dvdsubtitles.br.RB [ -hVkl ].RB [ -t.IR TITLE ].RB [ -s.IR SUBTITLE ].RB [ -o.IR TARGET ].RB [ -g.IR GREY_LEVELS ].RI [ SOURCE ].PP.B dvdsubtitles.B -c.RI ( FILE " | " DIRECTORY ).RB [ -o.IR TARGET ].PP.B dvdsubtitles.RB [ -hVkl ].RI [ SOURCE.RI [ TITLE.RI [ SUBTITLE.RI [ TARGET.RI [ GREY_LEVELS ]]]]].SH DESCRIPTIONUses.BR tccat (1)and.BR tcextract (1)from the.B transcodepackage to extract a subtitle stream from DVD data. This stream is convertedinto image files with.BR subtitle2pgm ,and those are converted to text files using.BR pgm2txt ,both from the.B subtitleripperpackage, which in turn calls.BR gocr (1)..PPThe previously created subtitle index file (.srtx) and the resulting textfiles are then compiled into one text file using either.BR srttool ,from the.B subtitleripperpackage, or.BR sed (1).(See Output Format below.).PPThe.B -coption allows for compiling existing text files into that format accordinga subtitle index file without extracting a subtitle stream first (see below).\" .PP\" If the\" .B -S\" option is used, this program also performs a minor correction of common\" misrecognition errors via\" .BR sed (1),\" i.e. a standalone `l' (small letter L) or one followed by an apostrophe\" is converted to `I' (capital letter I)..PPAll temporary files are deleted afterwards (`clean-up'), unless a fatal erroroccurred or a user interrupt was detected; the extracted subtitle stream fileis kept for future use if the.B -koption is used..PPBased on.B DVD ripping and transcoding with Linuxby Moritz Bunkus <moritz@bunkus.org>, available at.br<\fIhttp://www.bunkus.org/dvdripping4linux/\fP>..SS Output FormatThe format of the subtitle text file this program creates is similar to that the.B SubRipprogram creates:.PP.I Subtitle number.br.IB "Start time " --> " End time".br.I Text of subtitle (one or more lines).br.I Blank line.PPLike the SubRip format, field data starts at the beginning of each line.The time format used is `\fIhours\fB:\fIminutes\fB:\fIseconds\fR',.I hoursand.I minuteswith two digits each. The.I secondsfield is precise to three decimal points; the decimal separator used isthe comma..PPDifferent to the SubRip format, the line break used is thestandard UNIX Line Feed (LF, 0x0A) character. The.I Subtitle numberfield was not included before version 0.6.1..SH OPTIONSOptions are supported since version 0.4. This aims at achieving POSIXconformance and easy introduction of new features while maintainingbackwards compatibility to versions before 0.4..PPIf additional program arguments are used, any option argument isoverwritten by the corresponding program argument. Options may begiven in any order, and are also considered options if located afterthe first program argument. Too many program arguments are silentlyignored..IP "\fB-c\fP, \fB--compile\fP (\fIFILE\fP | \fIDIRECTORY\fP)"(since version 0.6.1, \fBTODO\fP) Compile one group, or all groups ofsubtitle text files in.IR DIRECTORY ,according to a corresponding subtitle index.I FILE(.srtx), into one text file each. If this is successful, clean up (see.BR -k )and exit.Options irrelevant to this process are ignored..RSIf a.I DIRECTORYis specified as argument, the.B -ooption is ignored. The resulting text files are named after thecorresponding subtitle index files found in the.I DIRECTORYinstead, and their name is suffixed with `\fB.srt\fP'..RE.IP "\fB-k\fP, \fB--keep\fP"(since version 0.6) Keep subtitle stream file even if conversion is successful..IP "\fB-l\fP, \fB--list\fP"(since version 0.5) List subtitles for.I TITLEusing.BR mplayer (1)and exit. If.I TITLEis not provided or.RB ` - ',list subtitles for title #2 (as title #1 may be an intro without subtitles) andexit..IP "\fISOURCE\fP"Video DVD data source, i.e. a device.RI "(usually " /dev/dvd ),a directory e.g. one containing content created via.BR dvdbackup (1),or a Video DVD image file..brIf.RB ` - ',a previously created subtitle stream file named\fBsubtitle_stream-\fP*\fB-\fP\fITITLE\fP-\fISUBTITLE\fPin the current working directory will be used for only thestream-to-graphics-to-text conversion instead. Both.I TITLEand.I SUBTITLEmust not be.BR ` - 'in that case..brThe default is.RI ` /dev/dvd '..IP "\fB-t\fP, \fB--title\fP \fITITLE\fP"Number of the title (1-n) which will be accessed for subtitle stream extraction.If omitted or.RB ` - ',the program uses.BR mplayer (1)to detect how many titles are available on the DVD data source and asks for thetitle to be accessed..IP "\fB-s\fP, \fB--subtitle-id\fP \fISUBTITLE\fP"ID of the subtitle stream to be extracted (0-n). If omitted or.RB ` - ',the program uses its.B -loption (or.BR mplayer (1)directly, before version 0.5) to detect which subtitles are available for thegiven TITLE and asks for the ID to be used..IP "\fB-o\fP, \fB--output-target\fP \fITARGET\fP"Name of the resulting subtitles text file. If not provided or.RB ` - ',the file is named after the subtitle stream file..RSVersions prior to 0.6 appended the filename suffix.B .txtautomagically always, and version 0.6 appended this suffix only if this optionwas not provided; since version 0.6.1, the filename suffix.B .srt(SubRip text) is appended in that case..PPIf the file already existed, behavior depends on the program version..IP "Since version 0.6.1:"The program asks whether the file should be overwritten, new content shouldbe appended to it (including a marker identifying the start of new content),or if a new file should be created. If the latter, the name of new fileincludes the ID of the.B dvdsubtitlesprocess which created it..IP "Version 0.6:"The program asks whether the file should be overwritten. If no, a new fileis created, its name including the ID of the.B dvdsubtitlesprocess which created it..IP "Versions prior to 0.6:"New content is appended to the file without marker..RE.IP "\fB-g\fP, \fB--grey-levels\fP \fIGREY_LEVELS\fP"Optional grey-levels value `\fIc0\fP,\fIc1\fP,\fIc2\fP,\fIc3\fP' with 0 <=.I cN<= 255, where 0 means black and 255 means white..RS.PPDVD subtitles allow up to 4 colors. The comma-separated arguments to thisoption specify the grey level for each these colors that are used for convertingthe subtitle stream graphics into plain text via OCR. The default is.RB ` 255,255,0,255 '.The values.RB ` 255,0,255,255 ',.RB ` 255,255,255,0 ',and.RB ` 0,255,255,255 'can also produce viable OCR input..PPUse solid (not outlined) shapes as input when possible to make things easierfor the.BR gocr (1)program. It will ask you about a character if it does not recognize it; ifthat has an outlined shape, you are advised to cancel the OCR process (withCtrl+C). This program will then allow you to use another grey-levels valuewithout the need to extract the subtitle stream again..PPSee the README file of the.B subtitleripperpackage and of the.B subtitle2pgmprogram, which -c option requires this value, for details. (See FILES below.).RE.IP "\fB-h\fP, \fB--help\fP"Display this help and exit..IP "\fB-V\fP, \fB--version\fP"Display version information and exit..SH "EXIT STATUS".TP.B " 0"Successful program execution.TP.B " 1"Error detecting/extracting subtitle stream, or cancelled without selecting atitle number or subtitle ID.TP.B " 2"Unable to convert subtitle stream to image files.TP.B " 3"Cancelled due to.BR gocr (1)error or without entering another grey-levels value.TP.B " 4"Unable to compile to text file.TP.B " 5"Unable to clean up.TP.B "127"Insufficient number of arguments / help was displayed.SH FILES.TP.I /usr/share/doc/subtitleripper/README.gzLocation of the.B subtitleripperpackage README on Debian systems.TP.I /usr/share/doc/subtitleripper/README.subtitle2pgm.gzLocation of the.B subtitle2pgmprogram README on Debian systems.SH NOTESTested with GNU/Linux 2.4.31 and 2.6.1.13 to .15.B [1](Debian.B [2]Sarge)..PP.B [1].RI < http://kernel.org/ >.br.B [2].RI < http://debian.org/ >.SH BUGSPlease send comments and bug reports to.RI < dvd@PointedEars.de >..SH "LEGAL NOTICE"Copyright (c) 2005, 2006 Thomas Lahn <dvd@PointedEars.de>.PPThis program is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License as published by theFree Software Foundation; either version 2 of the License, or (at youroption) any later version..PPThis program is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License(GPL) for more details.You should have received a copy of the GNU GPL along with this program.RI ( COPYING " file);"if not, go to.B [1]or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,Boston, MA 02110-1301, USA..PP.B [1].RI < http://www.gnu.org/licenses/licenses.html#GPL >.PP.br--.brStandard shell script disclaimer blurb thing:This script is a hack. It's brute force. It's horrible.It doesn't use Artificial Intelligence. It doesn't use Virtual Reality.It's not perl. It's not python. It probably won't work unchanged onthe "other" thousands of unices. But it worksforme. --ramiro.br(from.IR /usr/local/mozilla/run-mozilla.sh ).SH CREDITSThanks to Boris 'bolau' Lau <mail@bolau.de> for translation support,and to Erkan Yanar <erkan.yanar@t-online.de> for pointing out how touse.BR sed (1)to replace a filename with the file content..SH AVAILABILITYThe author's latest version can be obtained from.br.RI < http://PointedEars.de/tools/multimedia/dvd/ >..SH "SEE ALSO".BR dvdbackup (1),.BR gocr (1),.BR mplayer (1),.BR pgm2txt ,.BR sed (1),.BR srttool " and " subtitle2pgm(from <\fIhttp://subtitleripper.sourceforge.net/\fP>),.BR tccat (1),.BR tcextract (1)