mpeg2decode -03 input.mpg output.%04dUnfortunately, encoding an mpeg stream is more complicated. One must supply a parameter file.
mpeg2encode parameter_file output.mpgA sample parameter file that encodes a series of ppm files input.0000.ppm to input.0004.ppm into the mpeg-1 file, output.mpg, is PPMtoMPEG.par . Be sure to edit the lines indicating the number of frames (in this case 5), the horizontal size (320), vertical size (240), display horizontal size (320), and display vertical size (240). Other examples of parameter files are as follows:
Stolen from http://tns-www.lcs.mit.edu/manuals/mpeg2