523 lines
17 KiB
HTML
523 lines
17 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PPMTOMPEG</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PPMTOMPEG</H1>
|
|
Section: User Commands (1)<BR>Updated: 1 February 1995<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ppmtompeg - encodes MPEG-1 bitstreams
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>ppmtompeg</B>
|
|
|
|
[
|
|
<B></B><I>options</I>
|
|
|
|
]
|
|
<B></B><I>parameter-file</I>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>ppmtompeg</B>
|
|
|
|
produces an MPEG-1 video stream. param_file is a parameter file which
|
|
includes a list of input files and other parameters. The file is described
|
|
in detail below. The -gop, -combine_gops, -frames, and -combine_frames
|
|
options are all exclusive. This man page is probably incomplete. For
|
|
complete usage, see the User's Guide.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>-stat stat_file</B>
|
|
|
|
: causes the encoder to append the statistics to the file <I>stat_file</I>.
|
|
<DD>In any case, the statistics are output to stdout. The statistics use the
|
|
following abbreviations: bits per block (bpb), bits per frame (bpf),
|
|
seconds per frame (spf), and bits per second (bps).
|
|
<DT id="2">
|
|
<B>-quiet num_seconds</B>
|
|
|
|
: causes the program to not report remaining time for at least num_seconds
|
|
<DD>seconds. A negative values tells the program not to report at all. 0 is
|
|
the default (reports once after each frame). Note that the time remaining
|
|
is an estimate and does not take into account time to read in frames.
|
|
<DT id="3">
|
|
<B>-realquiet</B>
|
|
|
|
: causes the encoder to run silently, with the only screen output being errors.
|
|
<DD>Particularly useful when reading input from stdin.
|
|
<DT id="4">
|
|
<B>-no_frame_summary</B>
|
|
|
|
: prevents the program from printing a summary line for each frame
|
|
<DT id="5">
|
|
<B>-float_dct</B>
|
|
|
|
: forces the encoder to use a more accurate, yet more computationally expensive
|
|
<DD>version of the DCT.
|
|
<DT id="6">
|
|
<B>-gop gop_num</B>
|
|
|
|
: causes the encoder to only encode the numbered GOP (first GOP is 0). The
|
|
<DD>parameter file is the same as for normal usage. The output file will be
|
|
the normal output file with the suffix ".gop.<gop_num>" No sequence info
|
|
is output.
|
|
<DT id="7">
|
|
<B>-combine_gops</B>
|
|
|
|
: causes the encoder to simply combine some GOP files into a single MPEG
|
|
<DD>stream. A sequence header/ender are inserted. In this case, the parameter
|
|
file need only contain the YUV_SIZE value, an output file, and perhaps a
|
|
list of input GOP files (see below).
|
|
<DT id="8">
|
|
<B>-frames first_frame last_frame</B>
|
|
|
|
: causes the encoder to only encode the frames from first_frame to
|
|
<DD>last_frame, inclusive. The parameter file is the same as for normal usage.
|
|
The output will be placed in separate files, one per frame, with the file
|
|
names being the normal output file with the suffix ".frame.<frame num>" No
|
|
GOP header information is output. (Thus, the parameter file need not include
|
|
the GOP_SIZE value)
|
|
<DT id="9">
|
|
<B>-combine_frames</B>
|
|
|
|
: causes the encoder to simply combine some frames into a single MPEG stream.
|
|
<DD>Sequence and GOP headers are inserted appropriately. In this case, the
|
|
parameter file need only contain the YUV_SIZE
|
|
value, the GOP_SIZE value, an output file, and perhaps a list of frame
|
|
files (see below).
|
|
<DT id="10">
|
|
<B>-nice</B>
|
|
|
|
: causes the program to run any remote processes 'nicely.' This is only
|
|
<DD>relevant if the program is using parallel encoding. (see 'man nice.')
|
|
<DT id="11">
|
|
<B>-max_machines num_machines</B>
|
|
|
|
: causes the program to use no more than num_machines machines as slaves for
|
|
<DD>use in parallel encoding.
|
|
<DT id="12">
|
|
<B>-snr</B>
|
|
|
|
: print the signal-to-noise ratio. Prints SNR (Y U V) and peak SNR (Y U V)
|
|
<DD>for each frame. In summary, prints averages of luminance only (Y). SNR is
|
|
defined as 10*log(variance of original/variance of error). Peak SNR is
|
|
defined as 20*log(255/RMSE). Note that the encoder will run a little slower
|
|
if you want it to print the SNR.
|
|
<DT id="13">
|
|
<B>-mse</B>
|
|
|
|
: computes the mean squared error per block. Also automatically computes
|
|
<DD>the quality of the images when set, so there is no need to specify -snr then.
|
|
<DT id="14">
|
|
<B>-bit_rate_info rate_file</B>
|
|
|
|
: prints bit rate information into the file rate_file. Bit rate info is bits
|
|
<DD>per frame, and also bits per I-frame-to-I-frame.
|
|
<DT id="15">
|
|
<B>-mv-histogram</B>
|
|
|
|
: prints histogram of motion vectors as part of statistics. There are three
|
|
<DD>histograms -- one for P, forward B, and backward B vectors. Each histogram
|
|
is a 2-dimensional array, and there is one entry for each vector in the
|
|
search window.
|
|
<DT id="16">
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>PARAMETER FILE</H2>
|
|
|
|
<DD>The parameter file MUST contain the following lines (except when using the
|
|
-combine_gops or -combine_frames options):
|
|
<DL COMPACT>
|
|
<DT id="17">
|
|
<DL COMPACT><DT id="18"><DD>
|
|
<DD>PATTERN <pattern>
|
|
<DL COMPACT>
|
|
<DT id="19">
|
|
<DD>OUTPUT <output file>
|
|
<DT id="20">
|
|
<DD>INPUT_DIR <directory>
|
|
<DL COMPACT><DT id="21"><DD>
|
|
all input files must reside in this directory. If you want to refer to the
|
|
current directory, use '.' (an empty INPUT_DIR value would refer to the root
|
|
directory). If input files will be coming in from standard input, use
|
|
'stdin'.
|
|
</DL>
|
|
|
|
<DT id="22">
|
|
<DD>INPUT
|
|
<DL COMPACT><DT id="23"><DD>
|
|
This line must be followed by a list of the input files (in display order)
|
|
and then the line
|
|
<DL COMPACT><DT id="24"><DD>
|
|
END_INPUT
|
|
</DL>
|
|
|
|
There are three types of lines between INPUT and END_INPUT. First, a line
|
|
may simply be the name of an input file. Secondly, the line may be of the
|
|
form
|
|
<DL COMPACT><DT id="25"><DD>
|
|
<single_star_expr> [x-y]
|
|
</DL>
|
|
|
|
single_star_expr can have a single '*' in it. It is replaced by all the
|
|
numbers between x and y inclusive. So, for example, the line
|
|
<DL COMPACT><DT id="26"><DD>
|
|
tennis*.ppm [12-15]
|
|
</DL>
|
|
|
|
is replaced by tennis12.ppm, tennis13.ppm, tennis14.ppm, tennis15.ppm.
|
|
Uniform zero-padding occurs, as well. For example, the line
|
|
<DL COMPACT><DT id="27"><DD>
|
|
football.*.ppm [001-130]
|
|
</DL>
|
|
|
|
is replaced by football.001.ppm, football.002.ppm, ..., football.009.ppm,
|
|
football.010.ppm, ..., football.130.ppm. The third type of line is:
|
|
<DL COMPACT><DT id="28"><DD>
|
|
<single_star_expr> [x-y+s]
|
|
</DL>
|
|
|
|
Where the line is treated exactly as above, except that we skip by s. Thus,
|
|
the line
|
|
<DL COMPACT><DT id="29"><DD>
|
|
football.*.ppm [001-130+4]
|
|
</DL>
|
|
|
|
is replaced by football.001.ppm, football.005.ppm, football.009.ppm,
|
|
football.013.ppm, etc.
|
|
</DL>
|
|
|
|
<DT id="30">
|
|
<DD>BASE_FILE_FORMAT <YUV or PPM or PNM or JPEG or JMOVIE>
|
|
<DL COMPACT><DT id="31"><DD>
|
|
All the input files must be converted to YUV, JPEG(v4), JMOVIE, PNM, or PPM
|
|
format. This line specifies which of the three formats (actually PPM is a
|
|
subset of PNM). The reason for having a separate PPM option is for
|
|
simplicity. If your files are RAWBITS ppm files, then use the PPM option
|
|
rather than the PNM. Also, depending on the system, file reads will go much
|
|
faster with the PPM option (as opposed to PNM).
|
|
</DL>
|
|
|
|
<DT id="32">
|
|
<DD>INPUT_CONVERT <conversion command>
|
|
<DL COMPACT><DT id="33"><DD>
|
|
You must specify how to convert a file to the base file format. In the
|
|
conversion command, each '*' is replaced by the filename (the items listed
|
|
between INPUT and END_INPUT). If no conversion is necessary, then you would
|
|
just say:
|
|
<DL COMPACT><DT id="34"><DD>
|
|
INPUT_CONVERT *
|
|
</DL>
|
|
|
|
If you had a bunch of gif files, you might say:
|
|
<DL COMPACT><DT id="35"><DD>
|
|
INPUT_CONVERT giftoppm *
|
|
</DL>
|
|
|
|
If you have a bunch of separate a.Y, a.U, and a.V files, then you might say:
|
|
<DL COMPACT><DT id="36"><DD>
|
|
INPUT_CONVERT cat *.Y *.U *.V
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="37"><DD>
|
|
Input conversion is not allowed with input from stdin.
|
|
</DL>
|
|
|
|
<DL COMPACT>
|
|
<DT id="38">
|
|
<DD>GOP_SIZE <n>
|
|
<DL COMPACT><DT id="39"><DD>
|
|
n is roughly the number of frames in a Group of Pictures (roughly because
|
|
a GOP must begin with an I-frame)
|
|
</DL>
|
|
|
|
<DT id="40">
|
|
<DD>SLICES_PER_FRAME <n>
|
|
<DL COMPACT><DT id="41"><DD>
|
|
n is roughly the number of slices per frame. Note, at least one MPEG player
|
|
may complain if slices do not start at the left side of an image. To ensure
|
|
this does not happen, make sure the number of rows is divisible by
|
|
SLICES_PER_FRAME.
|
|
</DL>
|
|
|
|
<DT id="42">
|
|
<DD>PIXEL <FULL or HALF>
|
|
<DL COMPACT><DT id="43"><DD>
|
|
use half-pixel motion vectors, or only full-pixel ones
|
|
</DL>
|
|
|
|
<DT id="44">
|
|
<DD>RANGE <n>
|
|
<DL COMPACT><DT id="45"><DD>
|
|
use a search range of +/- n pixels
|
|
</DL>
|
|
|
|
<DT id="46">
|
|
<DD>PSEARCH_ALG <algorithm>
|
|
<DL COMPACT><DT id="47"><DD>
|
|
algorithm must be one of {EXHAUSTIVE, TWOLEVEL, SUBSAMPLE, LOGARITHMIC}.
|
|
Tells what kind of search procedure should be used for P-frames.
|
|
Exhaustive gives the best compression, but logarithmic is the
|
|
fastest. You select the desired combination of speed and compression.
|
|
TWOLEVEL is an exhaustive full-pixel search, followed by a local half-
|
|
pixel search around the best full-pixel vector (the PIXEL option is
|
|
ignored for this search algorithm).
|
|
</DL>
|
|
|
|
<DT id="48">
|
|
<DD>BSEARCH_ALG <algorithm>
|
|
<DL COMPACT><DT id="49"><DD>
|
|
algorithm must be one of {SIMPLE, CROSS2, EXHAUSTIVE}. Tells what kind of
|
|
search procedure should be used for B-frames. Simple means find best forward
|
|
and backward vectors, then interpolate. Cross2 means find those two vectors,
|
|
then see what backward vector best matches the best forward vector, and vice
|
|
versa. Exhaustive does an n-squared search and is EXTREMELY slow in
|
|
relation to the others (Cross2 is about twice as slow as Simple).
|
|
</DL>
|
|
|
|
<DT id="50">
|
|
<DD>IQSCALE <n>
|
|
<DL COMPACT><DT id="51"><DD>
|
|
use n as the qscale for I-frames
|
|
</DL>
|
|
|
|
<DT id="52">
|
|
<DD>PQSCALE <n>
|
|
<DL COMPACT><DT id="53"><DD>
|
|
use n as the qscale for P-frames
|
|
</DL>
|
|
|
|
<DT id="54">
|
|
<DD>BQSCALE <n>
|
|
<DL COMPACT><DT id="55"><DD>
|
|
use n as the qscale for B-frames
|
|
</DL>
|
|
|
|
<DT id="56">
|
|
<DD>REFERENCE_FRAME <ORIGINAL or DECODED>
|
|
<DL COMPACT><DT id="57"><DD>
|
|
If ORIGINAL is specified, then the original images are used when computing
|
|
motion vectors. To be more accurate, use DECODED, in which the decoded
|
|
images are used. This should increase the quality of the image, but will
|
|
take a bit longer to encode.
|
|
</DL>
|
|
|
|
The following lines are optional:
|
|
<DT id="58">
|
|
<DL COMPACT><DT id="59"><DD>
|
|
<DD>FORCE_I_ALIGN
|
|
<DL COMPACT><DT id="60"><DD>
|
|
This option is only relevant for parallel execution (see below). It forces
|
|
each processor to encode a block of N frames, where N must be a multiple of
|
|
the pattern length. Since the first frame in any pattern is an I-frame,
|
|
this forces each block encoded by a processor to begin with an I-frame.
|
|
</DL>
|
|
|
|
foo
|
|
</DL>
|
|
|
|
<DT id="61">
|
|
</DL>
|
|
</DL>
|
|
</DL>
|
|
</DL>
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<DD>If the BASE_FILE_FORMAT is YUV, then the parameter file must contain:
|
|
<DL COMPACT><DT id="62"><DD>
|
|
YUV_SIZE <w>x<h>
|
|
</DL>
|
|
|
|
where w = width, h = height (in pixels) of image, and
|
|
<DL COMPACT><DT id="63"><DD>
|
|
YUV_FORMAT <ABEKAS or PHILLIPS or UCB or EYUV or pattern>.
|
|
</DL>
|
|
|
|
See the file doc/INPUT.FORMAT for more information.
|
|
<P>
|
|
|
|
If the -combine-gops option is used, then only the YUV_SIZE and OUTPUT
|
|
values need be specified in the parameter file. In addition, the parameter
|
|
file may specify input GOP files in the same manner as normal input files
|
|
-- except instead of using INPUT_DIR, INPUT, and END_INPUT, use GOP_INPUT_DIR,
|
|
GOP_INPUT, and GOP_END_INPUT. If no input GOP files are specified, then the
|
|
default is to use the output file name with suffix ".gop.<gop_num>"
|
|
starting from 0 as the input files.
|
|
<P>
|
|
|
|
If the -combine-frames option is used, then only the YUV_SIZE, GOP_SIZE, and
|
|
OUTPUT
|
|
values need be specified in the parameter file. In addition, the parameter
|
|
file may specify input frame files in the same manner as normal input files
|
|
-- except instead of using INPUT_DIR, INPUT, and END_INPUT, use
|
|
FRAME_INPUT_DIR,
|
|
FRAME_INPUT, and FRAME_END_INPUT. If no input frame files are specified,
|
|
then the
|
|
default is to use the output file name with suffix ".frame.<frame_num>"
|
|
starting from 0 as the input files.
|
|
<P>
|
|
|
|
Any number of spaces and tabs may come between each option and value. Lines
|
|
beginning with '#' are ignored. Any other lines are ignored except for
|
|
those between INPUT and END_INPUT. This allows you to use the same
|
|
parameter file for normal usage and for -combine_gops and -combine_frames.
|
|
<P>
|
|
|
|
The encoder is case-sensitive so, except for file names and directories,
|
|
everything should be in upper case.
|
|
<P>
|
|
|
|
The lines may appear in any order, except the following exceptions.
|
|
INPUT must appear before END_INPUT (also, GOP_INPUT before GOP_END_INPUT and
|
|
FRAME_INPUT before FRAME_END_INPUT). All lines
|
|
between INPUT and END_INPUT must be the frames in play order.
|
|
<P>
|
|
|
|
The encoder is prepared to handle up to 16 B frames between reference
|
|
frames when encoding with input from stdin. To increase this amount,
|
|
change the constant B_FRAME_RUN in frame.c and recompile.
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT id="64">
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>PARALLEL OPERATION</H2>
|
|
|
|
<DD>The encoder may be run on multiple machines at once. To do so, add a line
|
|
"PARALLEL" in the parameter file, followed by a listing, one machine per
|
|
line, then "END_PARALLEL". Each of the lines should be in one of two forms.
|
|
If the machine has access to the file server, then the line should be:
|
|
<P>
|
|
|
|
<TT> </TT><machine> <user> <executable><BR>
|
|
<P>
|
|
|
|
The executable is normally ppmtompeg (you may need to give the complete path
|
|
if you've built for different architectures).
|
|
If the machine is a remote machine, then the line should be:
|
|
<P>
|
|
|
|
<TT> </TT>REMOTE <machine> <user> <executable> <parameter file><BR>
|
|
<P>
|
|
|
|
Full paths should generally be used when describing executables and parameter
|
|
files. This INCLUDES the parameter file given as an argument to the original
|
|
call to ppmtompeg. Also, .rhosts files on the appropriate machines should
|
|
have the appropriate information.
|
|
<P>
|
|
|
|
The encoder will use the original machine for the master and I/O server
|
|
processes, and uses the listed machines as slaves to do the computation.
|
|
<P>
|
|
|
|
Optional lines are
|
|
|
|
<DL COMPACT>
|
|
<DT id="65">
|
|
<DD>RSH <remote shell command>
|
|
<DL COMPACT><DT id="66"><DD>
|
|
The encoder uses the remote shell command to start processes on other
|
|
machines. The default command is 'rsh.' If your machine supports a
|
|
different command, specify it here.
|
|
</DL>
|
|
|
|
<DT id="67">
|
|
<DD>PARALLEL_TEST_FRAMES <n>
|
|
<DL COMPACT><DT id="68"><DD>
|
|
n is the number of frames to encode initially on each processor
|
|
</DL>
|
|
|
|
<DT id="69">
|
|
<DD>PARALLEL_TIME_CHUNKS <t>
|
|
<DL COMPACT><DT id="70"><DD>
|
|
subsequently, each slave processor will be asked to encode for approximately
|
|
t seconds. Smaller values of <t> increase communication, but improve load
|
|
balancing.
|
|
<DL COMPACT>
|
|
<DT id="71">
|
|
<DD>The default values for these two options are n = 3 frames and t = 30 seconds.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="72">
|
|
<DD>PARALLEL_PERFECT
|
|
<DL COMPACT><DT id="73"><DD>
|
|
If this line is present, then scheduling is done on the assumption that
|
|
work distribution will be perfectly even -- meaning that each machine is
|
|
about the same speed. The frames will simply be divided up evenly between
|
|
the processors. This has the advantage of very minimal scheduling overhead,
|
|
but is obviously wrong if machines have varying speeds, or if the network
|
|
load makes performance uneven.
|
|
</DL>
|
|
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>VERSION</H2>
|
|
|
|
This is version 1.5 it contins new features and bug fixes from version 1.3.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
Not really a bug, but at least a limitation: If writing to an output file,
|
|
ppmtompeg sometimes uses <filename>.* as temporary files.
|
|
<P>
|
|
|
|
No known bugs, but if you find any, report them to <A HREF="mailto:mpeg-bugs@plateau.cs.berkeley.edu">mpeg-bugs@plateau.cs.berkeley.edu</A>.
|
|
<DL COMPACT>
|
|
<DT id="74">
|
|
</DL>
|
|
<A NAME="lbAK"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="75">
|
|
<DD>Kevin Gong - University of California, Berkeley, <A HREF="mailto:keving@cs.berkeley.edu">keving@cs.berkeley.edu</A>
|
|
<DT id="76">
|
|
<DD>Ketan Patel - University of California, Berkeley, <A HREF="mailto:kpatel@cs.berkeley.edu">kpatel@cs.berkeley.edu</A>
|
|
<DT id="77">
|
|
<DD>Dan Wallach - University of California, Berkeley, <A HREF="mailto:dwallach@cs.berkeley.edu">dwallach@cs.berkeley.edu</A>
|
|
<DT id="78">
|
|
<DD>Darryl Brown - University of California, Berkeley, <A HREF="mailto:darryl@cs.berkeley.edu">darryl@cs.berkeley.edu</A>
|
|
<DT id="79">
|
|
<DD>Eugene Hung - University of California, Berkeley, <A HREF="mailto:eyhung@cs.berkeley.edu">eyhung@cs.berkeley.edu</A>
|
|
<DT id="80">
|
|
<DD>Steve Smoot - University of California, Berkeley, <A HREF="mailto:smoot@cs.berkeley.edu">smoot@cs.berkeley.edu</A>
|
|
<DT id="81">
|
|
<P>
|
|
<P>
|
|
</DL>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="82"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="83"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="84"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="85"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="86"><A HREF="#lbAF">PARAMETER FILE</A><DD>
|
|
<DT id="87"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="88"><A HREF="#lbAH">PARALLEL OPERATION</A><DD>
|
|
<DT id="89"><A HREF="#lbAI">VERSION</A><DD>
|
|
<DT id="90"><A HREF="#lbAJ">BUGS</A><DD>
|
|
<DT id="91"><A HREF="#lbAK">AUTHORS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:25 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|