EnglishFrenchSpanish

OnWorks favicon

subtitle2pgm - Online in the Cloud

Run subtitle2pgm in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command subtitle2pgm that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


subtitle2pgm - Convert a subtitle stream to pgm images.

SYNTAX


subtitle2pgm [-i <filename>] [-o <basename>] [-c <c0,c1,c2,c3>] [-g <format>] [-t
<format>] [-l <seconds>] [-C <border>] [-e <hh:mm:ss,n>] [-v] [-P]

DESCRIPTION


subtitle2pgm converts a subtitle stream to pgm images, (see: pgm(5)). The subtitle stream
is produced by tcextract(1), e.g.

tcextract -x ps1 -t vob -a 0x20 -i file.vob

and are piped directly into subtitle2pgm, e.g.

tcextract -x ps1 -t vob -a 0x20 -i file.vob | subtitle2pgm

If the subtitle stream already exists as a file, use the -i option to read from it, e.g.

subtitle2pgm -i subtitle_stream.ps1

OPTIONS


-i <filename>
Use <filename> for input instead of stdin.

-o <name>
Use <name> as the basename for output files. If no <name> was given, it defaults to
"movie_subtitle". Output file names are of the form nameXXXX.pgm where XXXX is a
title number. Caution: existing files will be overwritten without warning.

-c <c0,c1,c2,c3>
Override the default grey levels in output image. Default is 255,255,0,255. Valid
values are in the range 0<=c<=255 where 0 is black and 255 white.

-g <format>
Set output image format, where format is a number from 0 to 5.
0 PGM (default)
1 PPM
2 PGM.GZ
3 PNG_GRAY (simple gray image)
4 PNG_GRAY_ALPHA (gray image with alpha channel)
5 PNG_RGAB (8 bit RGB + alpha channel).

PPM and PGM.GZ output won't work unless the program was compiled with support for
it. -g 2 is recommended to save disk space.

-t <format>
Set the output format, where format is a number from 0 to 1.
0 (default) srtx-files used by srttool (see README.srttool)
1 XML file format usable by DVDauthor ( http://dvdauthor.sourceforge.net/ ).

-l <seconds>
Add <seconds> to PTS (Presentation Time Stamp) for every DVD-9 layer skip (default
0.0). The internal PTS in VOB files is reset to 0 when a new layer is started.
This is already handled by tcextract and should not be noticeable in subtitle2pgm.
If for some reason the timing is misadjusted after a layer skip, try adding an
appropriate offset with this option.

-C <border>
Reduce border around the text to <border> pixels. Many DVDs come with full screen
subtitles where only a tiny part is really covered with text. Thus saving only the
interesting part of the image saves space on your hard disk. Default: Don't crop.
Usually this option is used with a small value for <border> e.g. -C 0.

-e <hh:mm:ss,n>
Extract only n subtitles starting from the time stamp hh:mm:ss. This gives a
preview of what the subtitles would look like. E.g. -e 00:05:00,10 skips the first
5 minutes then outputs the next 10 subtitles.

-v Enables more output messages that usually aren't needed.

-P Write a progress report to show the program is doing something useful.

EXAMPLES


Suppose the current directory is a mounted DVD of "Foo", or contains the VOB files from
the DVD.

# change these as needed
MOVIE="Foo" # name of movie
TITLENO=1 # subtitle language number
VOBSET="`echo VTS_01_[0-9].VOB`" # not all movies start at '0'

# make 'pgm' files of the subtitles
cat $VOBSET | tcextract -x ps1 -t vob -a 0x2$TITLENO | subtitle2pgm -o "$MOVIE"
# Use OCR to convert them to text, (imperfectly)
pgm2txt -f en "$MOVIE"
# make a '.srt' file of it.
srttool -s -i "$MOVIE".srtx -o "$MOVIE".srt

The result is usually over a thousand '.pgm' and '.pgm.txt' files, plus the desired
'.srt' file. The '.srt' file will only be as good as the OCR, so expect errors.

View the resulting '.srt' over the movie, in a large antialiased yellow font:

mplayer -sub "$MOVIE".srt $VOBSET -ass -ass-color ffff0000 -ass-border-color 00000000
-ass-font-scale 1.8 -fontconfig -font Verdana

Use subtitle2pgm online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    GenX
    GenX
    GenX is a scientific program to refine
    x-ray refelcetivity, neutron
    reflectivity and surface x-ray
    diffraction data using the differential
    evolution algorithm....
    Download GenX
  • 2
    pspp4windows
    pspp4windows
    PSPP is a program for statistical
    analysis of sampled data. It is a free
    replacement for the proprietary program
    SPSS. PSPP has both text-based and
    graphical us...
    Download pspp4windows
  • 3
    Git Extensions
    Git Extensions
    Git Extensions is a standalone UI tool
    for managing Git repositories. It also
    integrates with Windows Explorer and
    Microsoft Visual Studio
    (2015/2017/2019). Th...
    Download Git Extensions
  • 4
    eSpeak: speech synthesis
    eSpeak: speech synthesis
    Text to Speech engine for English and
    many other languages. Compact size with
    clear but artificial pronunciation.
    Available as a command-line program with
    many ...
    Download eSpeak: speech synthesis
  • 5
    Sky Chart / Cartes du Ciel
    Sky Chart / Cartes du Ciel
    SkyChart is a software to draw chart of
    the night sky for the amateur astronomer
    from a bunch of stars and nebulae
    catalogs. See main web page for full
    download...
    Download Sky Chart / Cartes du Ciel
  • 6
    GSmartControl
    GSmartControl
    GSmartControl is a graphical user
    interface for smartctl. It allows you to
    inspect the hard disk and solid-state
    drive SMART data to determine its
    health, as w...
    Download GSmartControl
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqmktop
    coqmktop
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop
    coqtop
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    g.copygrass
    g.copygrass
    g.copy - Copies available data files in
    the current mapset search path to the
    user�s current mapset. KEYWORDS:
    general, map management ...
    Run g.copygrass
  • 6
    g.dirsepsgrass
    g.dirsepsgrass
    g.dirseps - Internal GRASS utility for
    converting directory separator
    characters. Converts any directory
    separator characters in the input string
    to or from na...
    Run g.dirsepsgrass
  • More »

Ad