First thing is to make sure you have a mpg encoder installed. One of the standards is Berkeley's encoder mpeg_encode. On the new Linux machines at USYD, this is no longer functional, so we went to ppmtompeg..
This has its own share of issues: the one that came with our redhat distribution didn't work, so we had to compile it from scratch. Just warning...
Now you have an encoder happening, you need an input file.
A good description of the input file can be found here:
Here's an example of what it should look like:
PATTERN: This is about the encoding of frames. This statement specifies the pattern (sequence) of I frames, P frames, and B frames. is just a sequence of the letters I, P, and B with nothing between. Checkout:
Here the output mpg is overturn2.mpg. The image files must be one of a few formats, of which ppms are the easiest to convert. If you have files in another format, you can use convert command to turn then into ppms manually. Alternatively, you can use the input_covert tag to do it for some formats on the fly, eg:
INPUT_CONVERT giftoppm *
GOP_SIZE is the number of frames in a Group of Pictures. Except that because a GOP must start with an I frame, ppmtompeg makes a GOP as much longer than n as it has to to make the next GOP start with an I frame. Normally, it makes sense to make your GOP size a multiple of your pattern length (the latter is determined by the PATTERN parameter file statement). See http://www.cvc.mun.ca/software/netpbm/doc/ppmtompeg.html#gop
SLICES_PER_FRAME 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.
INPUT_DIR directory all input files must reside in this directory. If you want to refer to the current directory, use '.' A null directory refers to the root directory. If input files will be coming in from standard input, use stdin.
INPUT:This line must be followed by a list of the input files (in display order) and then the line END_INPUT. 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
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
refers to the files tennis12.ppm, tennis13.ppm, tennis14.ppm, tennis15.ppm.
Uniform zero-padding occurs, as well. For example, the line
refers to the files football.001.ppm, football.002.ppm, ..., football.009.ppm, football.010.ppm, ..., football.130.ppm.
The third type of line is:
where the line is treated exactly as above, except that we skip by s. Thus, the line
refers to the files football.001.ppm, football.005.ppm, football.009.ppm, football.013.ppm, etc.
Back to http://www.geosci.usyd.edu.au/users/craig/