Mpeg2encode

VisIt uses the mpeg2encode program from the MPEG Software Simulation Group (thanks guys!!).

Although it is far and away the easiest to let VisIt interact with the mpeg2encode program, you can can also do it manually.

Setup

  • You should have all pre-existing frames in the same directory and with names that follow the form <stem>%d.ppm or <stem>%04d.ppm (%03d, %02d, etc are also fine).
  • You should know the path to mpeg2encode.
    • It is deployed with VisIt and can be found in the installation.
    • (/path/to/visit/bin/mpeg2encode)

Running

You run mpeg2encode as:

mpeg2encode param.params output.mpg

And the content of param.params is the following (note the CHANGETHIS in the comments):

Generated by VisIt (http://www.llnl.gov/visit), MPEG-1 Movie, 30 frames/sec
/dvsprod/viz/childs/fischer/f%04d /* CHANGETHIS */
-         /* name of reconstructed images ("-": do not store) */
-         /* name of intra quant matrix file     ("-": default matrix) */
-         /* name of non intra quant matrix file ("-": default matrix) */
-        /* name of statistics file ("-": stdout ) */
2         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
1140       /* CHANGETHIS: number of frames */
0         /* number of first frame */
00:00:00:00 /* timecode of first frame */
15        /* N (# of frames in GOP) */  # 15
3         /* M (I/P frame distance) */
1         /* ISO/IEC 11172-2 stream */
0         /* 0:frame pictures, 1:field pictures */
800        /* CHANGETHIS: horizontal_size */
450        /* CHANGETHIS: vertical_size */
8         /* aspect_ratio_information 8=CCIR601 625 line, 9=CCIR601 525 line */
5         /* frame_rate_code 1=23.976, 2=24, 3=25, 4=29.97, 5=30 frames/sec. */
104000000      /* bit_rate (bits/s) */
112       /* vbv_buffer_size (in multiples of 16 kbit) */
0         /* low_delay  */
0         /* constrained_parameters_flag */
4         /* Profile ID: Simple = 5, Main = 4, SNR = 3, Spatial = 2, High = 1 */
4         /* Level ID:   Low = 10, Main = 8, High 1440 = 6, High = 4          */
1         /* progressive_sequence */
1         /* chroma_format: 1=4:2:0, 2=4:2:2, 3=4:4:4 */
0         /* video_format: 0=comp., 1=PAL, 2=NTSC, 3=SECAM, 4=MAC, 5=unspec. */
5         /* color_primaries */
5         /* transfer_characteristics */
5         /* matrix_coefficients */
800        /* CHANGETHIS: display_horizontal_size */
450        /* CHANGETHIS: display_vertical_size */
0         /* intra_dc_precision (0: 8 bit, 1: 9 bit, 2: 10 bit, 3: 11 bit */
0         /* top_field_first */
1 1 1     /* frame_pred_frame_dct (I P B) */
0 0 0     /* concealment_motion_vectors (I P B) */
0 0 0     /* q_scale_type  (I P B) */
0 0 0     /* intra_vlc_format (I P B)*/
0 0 0     /* alternate_scan (I P B) */
0         /* repeat_first_field */
1         /* progressive_frame */
0         /* P distance between complete intra slice refresh */
0         /* rate control: r (reaction parameter) */
0         /* rate control: avg_act (initial average activity) */
0         /* rate control: Xi (initial I frame global complexity measure) */
0         /* rate control: Xp (initial P frame global complexity measure) */
0         /* rate control: Xb (initial B frame global complexity measure) */
0         /* rate control: d0i (initial I frame virtual buffer fullness) */
0         /* rate control: d0p (initial P frame virtual buffer fullness) */
0         /* rate control: d0b (initial B frame virtual buffer fullness) */
2 2 11 11 /* P:  forw_hor_f_code forw_vert_f_code search_width/height */
1 1 3  3  /* B1: forw_hor_f_code forw_vert_f_code search_width/height */
1 1 7  7  /* B1: back_hor_f_code back_vert_f_code search_width/height */
1 1 7  7  /* B2: forw_hor_f_code forw_vert_f_code search_width/height */
1 1 3  3  /* B2: back_hor_f_code back_vert_f_code search_width/height */