Penguin
Blame: ppmtompeg(1)
EditPageHistoryDiffInfoLikePages
Annotated edit history of ppmtompeg(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 PPMTOMPEG
2 !!!PPMTOMPEG
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 PARAMETER FILE
8 NOTES
9 PARALLEL OPERATION
10 VERSION
11 BUGS
12 AUTHORS
13 ----
14 !!NAME
15
16
17 ppmtompeg - encodes MPEG-1 bitstreams
18 !!SYNOPSIS
19
20
21 __ppmtompeg__ [[ ''options'' ]
22 ''parameter-file''
23 !!DESCRIPTION
24
25
26 __ppmtompeg__ produces an MPEG-1 video stream. param_file
27 is a parameter file which includes a list of input files and
28 other parameters. The file is described in detail below. The
29 -gop, -combine_gops, -frames, and -combine_frames options
30 are all exclusive. This man page is probably incomplete. For
31 complete usage, see the User's Guide.
32 !!OPTIONS
33
34
35 __-stat stat_file__ : causes the encoder to append the
36 statistics to the file ''stat_file''. In any case, the
37 statistics are output to stdout. The statistics use the
38 following abbreviations: bits per block (bpb), bits per
39 frame (bpf), seconds per frame (spf), and bits per second
40 (bps).
41
42
43 __-quiet num_seconds__ : causes the program to not report
44 remaining time for at least num_seconds seconds. A negative
45 values tells the program not to report at all. 0 is the
46 default (reports once after each frame). Note that the time
47 remaining is an estimate and does not take into account time
48 to read in frames.
49
50
51 __-realquiet__ : causes the encoder to run silently, with
52 the only screen output being errors. Particularly useful
53 when reading input from stdin.
54
55
56 __-no_frame_summary__ : prevents the program from
57 printing a summary line for each frame
58
59
60 __-float_dct__ : forces the encoder to use a more
61 accurate, yet more computationally expensive version of the
62 DCT.
63
64
65 __-gop gop_num__ : causes the encoder to only encode the
66 numbered GOP (first GOP is 0). The parameter file is the
67 same as for normal usage. The output file will be the normal
68 output file with the suffix
69 __
70
71
72 __-combine_gops__ : causes the encoder to simply combine
73 some GOP files into a single MPEG stream. A sequence
74 header/ender are inserted. In this case, the parameter file
75 need only contain the YUV_SIZE value, an output file, and
76 perhaps a list of input GOP files (see below).
77
78
79 __-frames first_frame last_frame__ : causes the encoder
80 to only encode the frames from first_frame to last_frame,
81 inclusive. The parameter file is the same as for normal
82 usage. The output will be placed in separate files, one per
83 frame, with the file names being the normal output file with
84 the suffix
85 __
86
87
88 __-combine_frames__ : causes the encoder to simply
89 combine some frames into a single MPEG stream. Sequence and
90 GOP headers are inserted appropriately. In this case, the
91 parameter file need only contain the YUV_SIZE value, the
92 GOP_SIZE value, an output file, and perhaps a list of frame
93 files (see below).
94
95
96 __-nice__ : causes the program to run any remote
97 processes 'nicely.' This is only relevant if the program is
98 using parallel encoding. (see 'man nice.')
99
100
101 __-max_machines num_machines__ : causes the program to
102 use no more than num_machines machines as slaves for use in
103 parallel encoding.
104
105
106 __-snr__ : print the signal-to-noise ratio. Prints SNR (Y
107 U V) and peak SNR (Y U V) for each frame. In summary, prints
108 averages of luminance only (Y). SNR is defined as
109 10*log(variance of original/variance of error). Peak SNR is
110 defined as 20*log(255/RMSE). Note that the encoder will run
111 a little slower if you want it to print the
112 SNR.
113
114
115 __-mse__ : computes the mean squared error per block.
116 Also automatically computes the quality of the images when
117 set, so there is no need to specify -snr then.
118
119
120 __-bit_rate_info rate_file__ : prints bit rate
121 information into the file rate_file. Bit rate info is bits
122 per frame, and also bits per
123 I-frame-to-I-frame.
124
125
126 __-mv-histogram__ : prints histogram of motion vectors as
127 part of statistics. There are three histograms -- one for P,
128 forward B, and backward B vectors. Each histogram is a
129 2-dimensional array, and there is one entry for each vector
130 in the search window.
131 !!PARAMETER FILE
132
133
134 The parameter file MUST contain the following lines (except
135 when using the -combine_gops or -combine_frames
136 options):
137
138
139 PATTERN
140
141
142 OUTPUT
143
144
145 INPUT_DIR
146
147
148 all input files must reside in this directory. If you want
149 to refer to the current directory, use '.' (an empty
150 INPUT_DIR value would refer to the root directory). If input
151 files will be coming in from standard input, use
152 'stdin'.
153
154
155 INPUT
156
157
158 This line must be followed by a list of the input files (in
159 display order) and then the line
160
161
162 END_INPUT
163
164
165 There are three types of lines between INPUT and END_INPUT.
166 First, a line may simply be the name of an input file.
167 Secondly, the line may be of the form
168
169
170
171
172 single_star_expr can have a single '*' in it. It is replaced
173 by all the numbers between x and y inclusive. So, for
174 example, the line
175
176
177 tennis*.ppm [[12-15]
178
179
180 is replaced by tennis12.ppm, tennis13.ppm, tennis14.ppm,
181 tennis15.ppm. Uniform zero-padding occurs, as well. For
182 example, the line
183
184
185 football.*.ppm [[001-130]
186
187
188 is replaced by football.001.ppm, football.002.ppm, ...,
189 football.009.ppm, football.010.ppm, ..., football.130.ppm.
190 The third type of line is:
191
192
193
194
195 Where the line is treated exactly as above, except that we
196 skip by s. Thus, the line
197
198
199 football.*.ppm [[001-130+4]
200
201
202 is replaced by football.001.ppm, football.005.ppm,
203 football.009.ppm, football.013.ppm, etc.
204
205
206 BASE_FILE_FORMAT
207
208
209 All the input files must be converted to YUV, JPEG(v4),
210 JMOVIE, PNM, or PPM format. This line specifies which of the
211 three formats (actually PPM is a subset of PNM). The reason
212 for having a separate PPM option is for simplicity. If your
213 files are RAWBITS ppm files, then use the PPM option rather
214 than the PNM. Also, depending on the system, file reads will
215 go much faster with the PPM option (as opposed to
216 PNM).
217
218
219 INPUT_CONVERT
220
221
222 You must specify how to convert a file to the base file
223 format. In the conversion command, each '*' is replaced by
224 the filename (the items listed between INPUT and END_INPUT).
225 If no conversion is necessary, then you would just
226 say:
227
228
229 INPUT_CONVERT *
230
231
232 If you had a bunch of gif files, you might say:
233
234
235 INPUT_CONVERT giftoppm *
236
237
238 If you have a bunch of separate a.Y, a.U, and a.V files,
239 then you might say:
240
241
242 INPUT_CONVERT cat *.Y *.U *.V
243
244
245 Input conversion is not allowed with input from
246 stdin.
247
248
249 GOP_SIZE
250
251
252 n is roughly the number of frames in a Group of Pictures
253 (roughly because a GOP must begin with an
254 I-frame)
255
256
257 SLICES_PER_FRAME
258
259
260 n is roughly the number of slices per frame. Note, at least
261 one MPEG player may complain if slices do not start at the
262 left side of an image. To ensure this does not happen, make
263 sure the number of rows is divisible by
264 SLICES_PER_FRAME.
265
266
267 PIXEL
268
269
270 use half-pixel motion vectors, or only full-pixel
271 ones
272
273
274 RANGE
275
276
277 use a search range of +/- n pixels
278
279
280 PSEARCH_ALG
281
282
283 algorithm must be one of {EXHAUSTIVE, TWOLEVEL, SUBSAMPLE,
284 LOGARITHMIC}. Tells what kind of search procedure should be
285 used for P-frames. Exhaustive gives the best compression,
286 but logarithmic is the fastest. You select the desired
287 combination of speed and compression. TWOLEVEL is an
288 exhaustive full-pixel search, followed by a local half-
289 pixel search around the best full-pixel vector (the PIXEL
290 option is ignored for this search algorithm).
291
292
293 BSEARCH_ALG
294
295
296 algorithm must be one of {SIMPLE, CROSS2, EXHAUSTIVE}. Tells
297 what kind of search procedure should be used for B-frames.
298 Simple means find best forward and backward vectors, then
299 interpolate. Cross2 means find those two vectors, then see
300 what backward vector best matches the best forward vector,
301 and vice versa. Exhaustive does an n-squared search and is
302 EXTREMELY slow in relation to the others (Cross2 is about
303 twice as slow as Simple).
304
305
306 IQSCALE
307
308
309 use n as the qscale for I-frames
310
311
312 PQSCALE
313
314
315 use n as the qscale for P-frames
316
317
318 BQSCALE
319
320
321 use n as the qscale for B-frames
322
323
324 REFERENCE_FRAME
325
326
327 If ORIGINAL is specified, then the original images are used
328 when computing motion vectors. To be more accurate, use
329 DECODED, in which the decoded images are used. This should
330 increase the quality of the image, but will take a bit
331 longer to encode.
332
333
334 The following lines are optional:
335
336
337 FORCE_I_ALIGN
338
339
340 This option is only relevant for parallel execution (see
341 below). It forces each processor to encode a block of N
342 frames, where N must be a multiple of the pattern length.
343 Since the first frame in any pattern is an I-frame, this
344 forces each block encoded by a processor to begin with an
345 I-frame.
346
347
348 foo
349 !!NOTES
350
351
352 If the BASE_FILE_FORMAT is YUV, then the parameter file must
353 contain:
354
355
356 YUV_SIZE
357
358
359 where w = width, h = height (in pixels) of image,
360 and
361
362
363 YUV_FORMAT
364
365
366 See the file doc/INPUT.FORMAT for more
367 information.
368
369
370 If the -combine-gops option is used, then only the YUV_SIZE
371 and OUTPUT values need be specified in the parameter file.
372 In addition, the parameter file may specify input GOP files
373 in the same manner as normal input files -- except instead
374 of using INPUT_DIR, INPUT, and END_INPUT, use GOP_INPUT_DIR,
375 GOP_INPUT, and GOP_END_INPUT. If no input GOP files are
376 specified, then the default is to use the output file name
377 with suffix
378
379
380 If the -combine-frames option is used, then only the
381 YUV_SIZE, GOP_SIZE, and OUTPUT values need be specified in
382 the parameter file. In addition, the parameter file may
383 specify input frame files in the same manner as normal input
384 files -- except instead of using INPUT_DIR, INPUT, and
385 END_INPUT, use FRAME_INPUT_DIR, FRAME_INPUT, and
386 FRAME_END_INPUT. If no input frame files are specified, then
387 the default is to use the output file name with suffix
388
389
390 Any number of spaces and tabs may come between each option
391 and value. Lines beginning with '#' are ignored. Any other
392 lines are ignored except for those between INPUT and
393 END_INPUT. This allows you to use the same parameter file
394 for normal usage and for -combine_gops and
395 -combine_frames.
396
397
398 The encoder is case-sensitive so, except for file names and
399 directories, everything should be in upper
400 case.
401
402
403 The lines may appear in any order, except the following
404 exceptions. INPUT must appear before END_INPUT (also,
405 GOP_INPUT before GOP_END_INPUT and FRAME_INPUT before
406 FRAME_END_INPUT). All lines between INPUT and END_INPUT must
407 be the frames in play order.
408
409
410 The encoder is prepared to handle up to 16 B frames between
411 reference frames when encoding with input from stdin. To
412 increase this amount, change the constant B_FRAME_RUN in
413 frame.c and recompile.
414 !!PARALLEL OPERATION
415
416
417 The encoder may be run on multiple machines at once. To do
418 so, add a line
419
420
421
422
423 The executable is normally ppmtompeg (you may need to give
424 the complete path if you've built for different
425 architectures). If the machine is a remote machine, then the
426 line should be:
427
428
429 REMOTE
430
431
432 Full paths should generally be used when describing
433 executables and parameter files. This INCLUDES the parameter
434 file given as an argument to the original call to ppmtompeg.
435 Also, .rhosts files on the appropriate machines should have
436 the appropriate information.
437
438
439 The encoder will use the original machine for the master and
440 I/O server processes, and uses the listed machines as slaves
441 to do the computation.
442
443
444 Optional lines are
445
446
447 RSH
448
449
450 The encoder uses the remote shell command to start processes
451 on other machines. The default command is 'rsh.' If your
452 machine supports a different command, specify it
453 here.
454
455
456 PARALLEL_TEST_FRAMES
457
458
459 n is the number of frames to encode initially on each
460 processor
461
462
463 PARALLEL_TIME_CHUNKS
464
465
466 subsequently, each slave processor will be asked to encode
467 for approximately t seconds. Smaller values of
468
469
470 The default values for these two options are n = 3 frames
471 and t = 30 seconds.
472
473
474 PARALLEL_PERFECT
475
476
477 If this line is present, then scheduling is done on the
478 assumption that work distribution will be perfectly even --
479 meaning that each machine is about the same speed. The
480 frames will simply be divided up evenly between the
481 processors. This has the advantage of very minimal
482 scheduling overhead, but is obviously wrong if machines have
483 varying speeds, or if the network load makes performance
484 uneven.
485 !!VERSION
486
487
488 This is version 1.5 it contins new features and bug fixes
489 from version 1.3.
490 !!BUGS
491
492
493 No known bugs, but if you find any, report them to
494 mpeg-bugs@plateau.cs.berkeley.edu.
2 LeonardoBrunnet 495
496 !!EXAMPLE
497
498 For a simple example take a look at http://www.es.usyd.edu.au/Geophysics/craig/howtompegs.html
499
1 perry 500 !!AUTHORS
501
502
503 Kevin Gong - University of California, Berkeley,
504 keving@cs.berkeley.edu
505
506
507 Ketan Patel - University of California, Berkeley,
508 kpatel@cs.berkeley.edu
509
510
511 Dan Wallach - University of California, Berkeley,
512 dwallach@cs.berkeley.edu
513
514
515 Darryl Brown - University of California, Berkeley,
516 darryl@cs.berkeley.edu
517
518
519 Eugene Hung - University of California, Berkeley,
520 eyhung@cs.berkeley.edu
521
522
523 Steve Smoot - University of California, Berkeley,
524 smoot@cs.berkeley.edu
525 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.