.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SUBS 1p" .TH SUBS 1p "2022-06-17" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" subs \- convert, join, split, and re\-time subtitles .SH "FORMAT" .IX Header "FORMAT" .Vb 1 \& subs [options] subfile [ subfile ... ] .Ve .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-a coeff, \-b time" 4 .IX Item "-a coeff, -b time" a and b coefficients in linear transformation u=at+b, where t and u are src and dest times ( default(identity transform) is [a=1,b=0] ). \-a can be set as ratio, f.ex. 23.9/25 .IP "\-c codec" 4 .IX Item "-c codec" Use codec to write file. Run 'subs \-h' for list of installed codecs. .IP "\-d" 4 .IX Item "-d" Try to prolong duration of quickly disappearing text. \&'Quickly' is less than 0.8 second per line of text. .IP "\-e command" 4 .IX Item "-e command" Run perl code for each line of text in file. On each run, the text and time variables are initialized, and new values, if any, written to the file. The variables are used for: .RS 4 .ie n .IP "$_" 4 .el .IP "\f(CW$_\fR" 4 .IX Item "$_" subtitle text line .ie n .IP "$b" 4 .el .IP "\f(CW$b\fR" 4 .IX Item "$b" cue beginning .ie n .IP "$e" 4 .el .IP "\f(CW$e\fR" 4 .IX Item "$e" cue end .ie n .IP "$i" 4 .el .IP "\f(CW$i\fR" 4 .IX Item "$i" line number .ie n .IP "$n" 4 .el .IP "\f(CW$n\fR" 4 .IX Item "$n" number of lines .ie n .IP "%p" 4 .el .IP "\f(CW%p\fR" 4 .IX Item "%p" persistent data between runs .RE .RS 4 .Sp The \-e option can be specified several times .RE .IP "\-h" 4 .IX Item "-h" Display help .IP "\-i" 4 .IX Item "-i" Edit files in place ( makes backup in .bak files ) .IP "\-j sec" 4 .IX Item "-j sec" Time interval between joins, seconds (default 2) .IP "\-o file" 4 .IX Item "-o file" File to save processed subtitles (default out.sub) .IP "\-O" 4 .IX Item "-O" Separate overlapped lines .IP "\-p t1 t2 or \-P t2 t1" 4 .IX Item "-p t1 t2 or -P t2 t1" Set a control point, where t1 is time of a phrase spoken in the film and t2 is time when the same phrase as appears in the subtitle. Two points are required for deducing \-a and \-b coefficients; if only one point is specified, it is assumed that the other one is [0,0]. .Sp Times can be relative, f.ex. \-p 01:00 +3.5 \-p \-20 1:00:00 .Sp Options \-P and \-p are the same except the argument sequence is reversed. \-P is to be used when arguments to \-p were typed manually and in wrong order. .IP "\-q t1 t2" 4 .IX Item "-q t1 t2" Restrict changes, if any, in time span t1\-t2. Word 'end' can be used as an alias to the end of the file. Default values are '0' and 'end'. .IP "\-r rate" 4 .IX Item "-r rate" Force frame-per-second rate for frame-based subs .IP "\-s time" 4 .IX Item "-s time" Split in two parts by time .IP "\-v" 4 .IX Item "-v" Be verbose .IP "\-z file.sub" 4 .IX Item "-z file.sub" Zip subtitle files so time information is read from file.sub, while text information is read from the input file(s). .SH "NOTES" .IX Header "NOTES" The time format is either [[\s-1HH:\s0]MM:]SS[.MSEC] or subtitle format-specific .SH "EXAMPLES" .IX Header "EXAMPLES" Warning: \-i is a great feature, but use it with certain caution. .PP If subtitles are shown too early ( 5 seconds): .PP .Vb 1 \& subs \-i \-b 5 file.sub .Ve .PP If subtitles are for a movie in 25 fps, need to be for 24 ( actual for frame-based formats only ). .PP .Vb 1 \& subs \-i \-a 24/25 file.sub .Ve .PP If subtitles start ok, but in 1 hour are late in 7 seconds: .PP .Vb 1 \& subs \-i \-p 0 0 \-p 1:00:00 +7 file.sub .Ve .PP Join two parts with 15\-second gap .PP .Vb 1 \& subs \-o joined.sub \-j 15 part1.sub part2.sub .Ve .PP Split in two after 50 minutes and half a second ( makes basename.1.sub and basename.2.sub ). .PP .Vb 1 \& subs \-o basename.sub \-s 50:00.5 toobig.sub .Ve .PP Remove closed caption-specific comments such as '[Sneezing]' or '[Music playing]' .PP .Vb 1 \& subs \-e \*(Aqs/[\es\-]*\e[.*\e]\es*\en*//gs\*(Aq sub.sub .Ve .SH "BUGS" .IX Header "BUGS" Subtitles written as \f(CW\*(C`.smi\*(C'\fR format may differ from original. .SH "SEE ALSO" .IX Header "SEE ALSO" Subtitles \- backend module for this program .SH "AUTHOR" .IX Header "AUTHOR" Dmitry Karasik, .