Subversion Repositories LCARS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 PointedEar 1
\" dvdsubtitles.1 - the *roff document processor src for the dvdsubtitles manual
2
\"
3
\" This file is part of PointedEars' DVD Subtitles.
4
\" Copyright (C) 2005, 2006  Thomas Lahn <dvd@PointedEars.de>
5
\"
6
\" Permission is granted to copy, distribute and/or modify this document
7
\" under the terms of the GNU Free Documentation License, Version 1.2
8
\" or any later version published by the Free Software Foundation;
9
\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
10
\" Texts.  A copy of the license is available on the Web[1] or
11
\" from the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
12
\" Boston, MA  02110-1301  USA.
13
\"
14
\" [1] <http://www.gnu.org/licenses/licenses.html#FDL>
15
\"
16
\" You may contact the author by:
17
\" e-mail: dvd@PointedEars.de
18
\" snail mail:
19
\"   Thomas Lahn
20
\"   Warschauer Strasse 1a/0403
21
\"   D-99089 Erfurt
22
\"   Federal Republic of Germany
23
 
24
.TH dvdsubtitles 1 "2006-02-15" "0.6.1.2006021519" "DVD Tools"
25
 
26
 
27
.SH NAME
28
dvdsubtitles \- Extract subtitle stream from Video DVD data to text file
29
 
30
 
31
.SH SYNOPSIS
32
 
33
.B dvdsubtitles
34
.br
35
.RB [ -hVkl ]
36
.RB [ -t
37
.IR TITLE ]
38
.RB [ -s
39
.IR SUBTITLE ]
40
.RB [ -o
41
.IR TARGET ]
42
.RB [ -g
43
.IR GREY_LEVELS ]
44
.RI [ SOURCE ]
45
 
46
.PP
47
.B dvdsubtitles
48
.B -c
49
.RI ( FILE " | " DIRECTORY )
50
.RB [ -o
51
.IR TARGET ]
52
 
53
.PP
54
.B dvdsubtitles
55
.RB [ -hVkl ]
56
.RI [ SOURCE
57
.RI [ TITLE
58
.RI [ SUBTITLE
59
.RI [ TARGET
60
.RI [ GREY_LEVELS ]]]]]
61
 
62
 
63
.SH DESCRIPTION
64
 
65
Uses
66
.BR tccat (1)
67
and
68
.BR tcextract (1)
69
from the
70
.B transcode
71
package to extract a subtitle stream from DVD data.  This stream is converted
72
into image files with
73
.BR subtitle2pgm ,
74
and those are converted to text files using
75
.BR pgm2txt ,
76
both from the
77
.B subtitleripper
78
package, which in turn calls
79
.BR gocr (1).
80
.PP
81
The previously created subtitle index file (.srtx) and the resulting text
82
files are then compiled into one text file using either
83
.BR srttool ,
84
from the
85
.B subtitleripper
86
package, or
87
.BR sed (1).
88
(See Output Format below.)
89
.PP
90
The
91
.B -c
92
option allows for compiling existing text files into that format according
93
a subtitle index file without extracting a subtitle stream first (see below).
94
\" .PP
95
\" If the
96
\" .B -S
97
\" option is used, this program also performs a minor correction of common
98
\" misrecognition errors via
99
\" .BR sed (1),
100
\" i.e. a standalone `l' (small letter L) or one followed by an apostrophe
101
\" is converted to `I' (capital letter I).
102
.PP
103
All temporary files are deleted afterwards (`clean-up'), unless a fatal error
104
occurred or a user interrupt was detected; the extracted subtitle stream file
105
is kept for future use if the
106
.B -k
107
option is used.
108
.PP
109
Based on
110
.B DVD ripping and transcoding with Linux
111
by Moritz Bunkus <moritz@bunkus.org>, available at
112
.br
113
<\fIhttp://www.bunkus.org/dvdripping4linux/\fP>.
114
 
115
.SS Output Format
116
The format of the subtitle text file this program creates is similar to that the
117
.B SubRip
118
program creates:
119
.PP
120
.I Subtitle number
121
.br
122
.IB "Start time " --> " End time"
123
.br
124
.I Text of subtitle (one or more lines)
125
.br
126
.I Blank line
127
.PP
128
Like the SubRip format, field data starts at the beginning of each line.
129
The time format used is `\fIhours\fB:\fIminutes\fB:\fIseconds\fR',
130
.I hours
131
and
132
.I minutes
133
with two digits each. The
134
.I seconds
135
field is precise to three decimal points; the decimal separator used is
136
the comma.
137
.PP
138
Different to the SubRip format, the line break used is the
139
standard UNIX Line Feed (LF, 0x0A) character.  The
140
.I Subtitle number
141
field was not included before version 0.6.1.
142
 
143
 
144
.SH OPTIONS
145
 
146
Options are supported since version 0.4.  This aims at achieving POSIX
147
conformance and easy introduction of new features while maintaining
148
backwards compatibility to versions before 0.4.
149
.PP
150
If additional program arguments are used, any option argument is
151
overwritten by the corresponding program argument.  Options may be
152
given in any order, and are also considered options if located after
153
the first program argument.  Too many program arguments are silently
154
ignored.
155
 
156
.IP "\fB-c\fP, \fB--compile\fP (\fIFILE\fP | \fIDIRECTORY\fP)"
157
(since version 0.6.1, \fBTODO\fP)  Compile one group, or all groups of
158
subtitle text files in
159
.IR DIRECTORY ,
160
according to a corresponding subtitle index
161
.I FILE
162
(.srtx), into one text file each.  If this is successful, clean up (see
163
.BR -k )
164
and exit.
165
Options irrelevant to this process are ignored.
166
 
167
.RS
168
If a
169
.I DIRECTORY
170
is specified as argument, the
171
.B -o
172
option is ignored.  The resulting text files are named after the
173
corresponding subtitle index files found in the
174
.I DIRECTORY
175
instead, and their name is suffixed with `\fB.srt\fP'.
176
.RE
177
 
178
.IP "\fB-k\fP, \fB--keep\fP"
179
(since version 0.6)  Keep subtitle stream file even if conversion is successful.
180
 
181
.IP "\fB-l\fP, \fB--list\fP"
182
(since version 0.5)  List subtitles for
183
.I TITLE
184
using
185
.BR mplayer (1)
186
and exit.  If
187
.I TITLE
188
is not provided or
189
.RB ` - ',
190
list subtitles for title #2 (as title #1 may be an intro without subtitles) and
191
exit.
192
 
193
.IP "\fISOURCE\fP"
194
Video DVD data source, i.e. a device
195
.RI "(usually " /dev/dvd ),
196
a directory e.g. one containing content created via
197
.BR dvdbackup (1),
198
or a Video DVD image file.
199
.br
200
If
201
.RB ` - ',
202
a previously created subtitle stream file named
203
\fBsubtitle_stream-\fP*\fB-\fP\fITITLE\fP-\fISUBTITLE\fP
204
in the current working directory will be used for only the
205
stream-to-graphics-to-text conversion instead.  Both
206
.I TITLE
207
and
208
.I SUBTITLE
209
must not be
210
.BR ` - '
211
in that case.
212
.br
213
The default is
214
.RI ` /dev/dvd '.
215
 
216
.IP "\fB-t\fP, \fB--title\fP \fITITLE\fP"
217
Number of the title (1-n) which will be accessed for subtitle stream extraction.
218
If omitted or
219
.RB ` - ',
220
the program uses
221
.BR mplayer (1)
222
to detect how many titles are available on the DVD data source and asks for the
223
title to be accessed.
224
 
225
.IP "\fB-s\fP, \fB--subtitle-id\fP \fISUBTITLE\fP"
226
ID of the subtitle stream to be extracted (0-n).  If omitted or
227
.RB ` -  ',
228
the program uses its
229
.B -l
230
option (or
231
.BR mplayer (1)
232
directly, before version 0.5) to detect which subtitles are available for the
233
given TITLE and asks for the ID to be used.
234
 
235
.IP "\fB-o\fP, \fB--output-target\fP \fITARGET\fP"
236
Name of the resulting subtitles text file.  If not provided or
237
.RB ` - ',
238
the file is named after the subtitle stream file.
239
 
240
.RS
241
Versions prior to 0.6 appended the filename suffix
242
.B .txt
243
automagically always, and version 0.6 appended this suffix only if this option
244
was not provided; since version 0.6.1, the filename suffix
245
.B .srt
246
(SubRip text) is appended in that case.
247
 
248
.PP
249
If the file already existed, behavior depends on the program version.
250
 
251
.IP "Since version 0.6.1:"
252
The program asks whether the file should be overwritten, new content should
253
be appended to it (including a marker identifying the start of new content),
254
or if a new file should be created.  If the latter, the name of new file
255
includes the ID of the
256
.B dvdsubtitles
257
process which created it.
258
 
259
.IP "Version 0.6:"
260
The program asks whether the file should be overwritten. If no, a new file
261
is created, its name including the ID of the
262
.B dvdsubtitles
263
process which created it.
264
 
265
.IP "Versions prior to 0.6:"
266
New content is appended to the file without marker.
267
.RE
268
 
269
.IP "\fB-g\fP, \fB--grey-levels\fP \fIGREY_LEVELS\fP"
270
Optional grey-levels value `\fIc0\fP,\fIc1\fP,\fIc2\fP,\fIc3\fP' with 0 <=
271
.I cN
272
<= 255, where 0 means black and 255 means white.
273
 
274
.RS
275
.PP
276
DVD subtitles allow up to 4 colors.  The comma-separated arguments to this
277
option specify the grey level for each these colors that are used for converting
278
the subtitle stream graphics into plain text via OCR.  The default is
279
.RB ` 255,255,0,255 '.
280
The values
281
.RB ` 255,0,255,255 ',
282
.RB ` 255,255,255,0 ',
283
and
284
.RB ` 0,255,255,255 '
285
can also produce viable OCR input.
286
 
287
.PP
288
Use solid (not outlined) shapes as input when possible to make things easier
289
for the
290
.BR gocr (1)
291
program.  It will ask you about a character if it does not recognize it; if
292
that has an outlined shape, you are advised to cancel the OCR process (with
293
Ctrl+C).  This program will then allow you to use another grey-levels value
294
without the need to extract the subtitle stream again.
295
 
296
.PP
297
See the README file of the
298
.B subtitleripper
299
package and of the
300
.B subtitle2pgm
301
program, which -c option requires this value, for details.  (See FILES below.)
302
.RE
303
 
304
.IP "\fB-h\fP, \fB--help\fP"
305
Display this help and exit.
306
 
307
.IP "\fB-V\fP, \fB--version\fP"
308
Display version information and exit.
309
 
310
 
311
.SH "EXIT STATUS"
312
 
313
.TP
314
.B "  0"
315
Successful program execution
316
 
317
.TP
318
.B "  1"
319
Error detecting/extracting subtitle stream, or cancelled without selecting a
320
title number or subtitle ID
321
 
322
.TP
323
.B "  2"
324
Unable to convert subtitle stream to image files
325
 
326
.TP
327
.B "  3"
328
Cancelled due to
329
.BR gocr (1)
330
error or without entering another grey-levels value
331
 
332
.TP
333
.B "  4"
334
Unable to compile to text file
335
 
336
.TP
337
.B "  5"
338
Unable to clean up
339
 
340
.TP
341
.B "127"
342
Insufficient number of arguments / help was displayed
343
 
344
 
345
.SH FILES
346
.TP
347
.I /usr/share/doc/subtitleripper/README.gz
348
Location of the
349
.B subtitleripper
350
package README on Debian systems
351
 
352
.TP
353
.I /usr/share/doc/subtitleripper/README.subtitle2pgm.gz
354
Location of the
355
.B subtitle2pgm
356
program README on Debian systems
357
 
358
 
359
.SH NOTES
360
Tested with GNU/Linux 2.4.31 and 2.6.1.13 to .15
361
.B [1]
362
(Debian
363
.B [2]
364
Sarge).
365
 
366
.PP
367
.B [1]
368
.RI < http://kernel.org/ >
369
.br
370
.B [2]
371
.RI < http://debian.org/ >
372
 
373
 
374
.SH BUGS
375
Please send comments and bug reports to
376
.RI < dvd@PointedEars.de >.
377
 
378
 
379
.SH "LEGAL NOTICE"
380
Copyright (c) 2005, 2006  Thomas Lahn <dvd@PointedEars.de>
381
.PP
382
This program is free software; you can redistribute it and/or modify it
383
under the terms of the GNU General Public License as published by the
384
Free Software Foundation; either version 2 of the License, or (at your
385
option) any later version.
386
.PP
387
This program is distributed in the hope that it will be useful, but
388
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
389
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
390
(GPL) for more details.
391
 
392
You should have received a copy of the GNU GPL along with this program
393
.RI ( COPYING " file);"
394
if not, go to
395
.B [1]
396
or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
397
Boston, MA  02110-1301, USA.
398
.PP
399
.B [1]
400
.RI < http://www.gnu.org/licenses/licenses.html#GPL >
401
.PP
402
.br
403
--
404
.br
405
Standard shell script disclaimer blurb thing:
406
 
407
This script is a hack.  It's brute force.  It's horrible.
408
It doesn't use Artificial Intelligence.  It doesn't use Virtual Reality.
409
It's not perl.  It's not python.  It probably won't work unchanged on
410
the "other" thousands of unices.  But it worksforme.  --ramiro
411
.br
412
(from
413
.IR /usr/local/mozilla/run-mozilla.sh )
414
 
415
 
416
.SH CREDITS
417
Thanks to Boris 'bolau' Lau <mail@bolau.de> for translation support,
418
and to Erkan Yanar <erkan.yanar@t-online.de> for pointing out how to
419
use
420
.BR sed (1)
421
to replace a filename with the file content.
422
 
423
 
424
.SH AVAILABILITY
425
The author's latest version can be obtained from
426
.br
427
.RI < http://PointedEars.de/tools/multimedia/dvd/ >.
428
 
429
 
430
.SH "SEE ALSO"
431
 
432
.BR dvdbackup (1),
433
.BR gocr (1),
434
.BR mplayer (1),
435
.BR pgm2txt ,
436
.BR sed (1),
437
.BR srttool " and " subtitle2pgm
438
(from <\fIhttp://subtitleripper.sourceforge.net/\fP>),
439
.BR tccat (1),
440
.BR tcextract (1)