mpeg2enc

mpeg2enc — High-quality MPEG-1/2 video encoder

Synopsis

                    GstMpeg2enc;

Object Hierarchy

  GObject
   +----GstObject
         +----GstElement
               +----GstMpeg2enc

Implemented Interfaces

GstMpeg2enc implements GstPreset.

Properties

  "altscan-mpeg2"            gboolean              : Read / Write
  "aspect"                   GstMpeg2encAspect     : Read / Write
  "b-per-refframe"           gint                  : Read / Write
  "bitrate"                  gint                  : Read / Write
  "bufsize"                  gint                  : Read / Write
  "closed-gop"               gboolean              : Read / Write
  "constraints"              gboolean              : Read / Write
  "correct-svcd-hds"         gboolean              : Read / Write
  "dualprime"                gboolean              : Read / Write
  "dummy-svcd-sof"           gboolean              : Read / Write
  "force-b-b-p"              gboolean              : Read / Write
  "format"                   GstMpeg2encFormat     : Read / Write
  "framerate"                GstMpeg2encFramerate  : Read / Write
  "interlace-mode"           GstMpeg2encInterlaceMode  : Read / Write
  "intra-dc-prec"            gint                  : Read / Write
  "keep-hf"                  gboolean              : Read / Write
  "max-gop-size"             gint                  : Read / Write
  "min-gop-size"             gint                  : Read / Write
  "motion-search-radius"     gint                  : Read / Write
  "non-video-bitrate"        gint                  : Read / Write
  "norm"                     GstMpeg2encVideoNorm  : Read / Write
  "playback-field-order"     GstMpeg2encPlaybackFieldOrders  : Read / Write
  "pulldown-3-2"             gboolean              : Read / Write
  "quant-matrix"             GstMpeg2encQuantisationMatrix  : Read / Write
  "quant-reduction-max-var"  gfloat                : Read / Write
  "quantisation"             gint                  : Read / Write
  "quantisation-reduction"   gfloat                : Read / Write
  "reduce-hf"                gfloat                : Read / Write
  "reduction-2x2"            gint                  : Read / Write
  "reduction-4x4"            gint                  : Read / Write
  "sequence-header-every-gop" gboolean              : Read / Write
  "sequence-length"          gint                  : Read / Write
  "unit-coeff-elim"          gint                  : Read / Write
  "vcd-still-size"           gint                  : Read / Write

Description

This element encodes raw video into an MPEG-1/2 elementary stream using the mjpegtools library. Documentation on MPEG encoding in general can be found in the MJPEG Howto and on the various available parameters in the documentation of the mpeg2enc tool in particular, which shares options with this element.

Example pipeline

1
gst-launch-0.10 videotestsrc num-buffers=1000 ! mpeg2enc ! filesink location=videotestsrc.m1v
This example pipeline will encode a test video source to a an MPEG1 elementary stream (with Generic MPEG1 profile).

Likely, the "format" property is most important, as it selects the type of MPEG stream that is produced. In particular, default property values are dependent on the format, and can even be forcibly restrained to certain pre-sets (and thereby ignored). Note that the (S)VCD profiles also restrict the image size, so some scaling may be needed to accomodate this. The so-called generic profiles (as used in the example above) allow most parameters to be adjusted.

1
gst-launch-0.10 videotestsrc num-buffers=1000 ! videoscale ! mpeg2enc format=1 norm=p ! filesink location=videotestsrc.m1v
This will produce an MPEG1 profile stream according to VCD2.0 specifications for PAL "norm" (as the image height is dependent on video norm).

Details

GstMpeg2enc

typedef struct _GstMpeg2enc GstMpeg2enc;

Property Details

The "altscan-mpeg2" property

  "altscan-mpeg2"            gboolean              : Read / Write

Alternate MPEG-2 block scanning. Disabling this might make buggy players play SVCD streams.

Default value: TRUE


The "aspect" property

  "aspect"                   GstMpeg2encAspect     : Read / Write

Display aspect ratio.

Default value: Deduce from input


The "b-per-refframe" property

  "b-per-refframe"           gint                  : Read / Write

Number of B frames between each I/P frame.

Allowed values: [0,2]

Default value: 0


The "bitrate" property

  "bitrate"                  gint                  : Read / Write

Compressed video bitrate (kbps).

Allowed values: [0,10000]

Default value: 1125


The "bufsize" property

  "bufsize"                  gint                  : Read / Write

Target decoders video buffer size (kB) (default depends on format).

Allowed values: [20,4000]

Default value: 46


The "closed-gop" property

  "closed-gop"               gboolean              : Read / Write

All Group-of-Pictures are closed (for multi-angle DVDs).

Default value: FALSE


The "constraints" property

  "constraints"              gboolean              : Read / Write

Use strict video resolution and bitrate checks.

Default value: TRUE


The "correct-svcd-hds" property

  "correct-svcd-hds"         gboolean              : Read / Write

Force SVCD width to 480 instead of 540/720.

Default value: FALSE


The "dualprime" property

  "dualprime"                gboolean              : Read / Write

Dual Prime Motion Estimation Mode for MPEG-2 I/P-frame only streams. Quite some players do not support this.

Default value: FALSE


The "dummy-svcd-sof" property

  "dummy-svcd-sof"           gboolean              : Read / Write

Generate dummy SVCD scan-data (for vcdimager).

Default value: TRUE


The "force-b-b-p" property

  "force-b-b-p"              gboolean              : Read / Write

Force two B frames between I/P frames when closing GOP boundaries.

Default value: FALSE


The "format" property

  "format"                   GstMpeg2encFormat     : Read / Write

Encoding profile format.

Default value: Generic MPEG-1


The "framerate" property

  "framerate"                GstMpeg2encFramerate  : Read / Write

Output framerate.

Default value: Same as input


The "interlace-mode" property

  "interlace-mode"           GstMpeg2encInterlaceMode  : Read / Write

MPEG-2 motion estimation and encoding modes.

Default value: Progressive


The "intra-dc-prec" property

  "intra-dc-prec"            gint                  : Read / Write

Number of bits precision for DC (base colour) in MPEG-2 blocks.

Allowed values: [8,11]

Default value: 9


The "keep-hf" property

  "keep-hf"                  gboolean              : Read / Write

Maximize high-frequency resolution (for high-quality sources).

Default value: FALSE


The "max-gop-size" property

  "max-gop-size"             gint                  : Read / Write

Maximal size per Group-of-Pictures (-1=default).

Allowed values: [G_MAXULONG,250]

Default value: -1


The "min-gop-size" property

  "min-gop-size"             gint                  : Read / Write

Minimal size per Group-of-Pictures (-1=default).

Allowed values: [G_MAXULONG,250]

Default value: -1


The "motion-search-radius" property

  "motion-search-radius"     gint                  : Read / Write

Motion compensation search radius.

Allowed values: [0,32]

Default value: 16


The "non-video-bitrate" property

  "non-video-bitrate"        gint                  : Read / Write

Assumed bitrate of non-video for sequence splitting (kbps).

Allowed values: [0,10000]

Default value: 0


The "norm" property

  "norm"                     GstMpeg2encVideoNorm  : Read / Write

Tag output for specific video norm.

Default value: Unspecified


The "playback-field-order" property

  "playback-field-order"     GstMpeg2encPlaybackFieldOrders  : Read / Write

Force specific playback field order.

Default value: Unspecified


The "pulldown-3-2" property

  "pulldown-3-2"             gboolean              : Read / Write

Generate header flags for 3-2 pull down 24fps movies.

Default value: FALSE


The "quant-matrix" property

  "quant-matrix"             GstMpeg2encQuantisationMatrix  : Read / Write

Quantisation matrix to use for encoding.

Default value: Default


The "quant-reduction-max-var" property

  "quant-reduction-max-var"  gfloat                : Read / Write

Maximal luma variance below which quantisation boost is used.

Allowed values: [0,2500]

Default value: 100


The "quantisation" property

  "quantisation"             gint                  : Read / Write

Quantisation factor (-1=cbr, 0=default, 1=best, 31=worst).

Allowed values: [G_MAXULONG,31]

Default value: 0


The "quantisation-reduction" property

  "quantisation-reduction"   gfloat                : Read / Write

Max. quantisation reduction for highly active blocks.

Allowed values: [-4,10]

Default value: 0


The "reduce-hf" property

  "reduce-hf"                gfloat                : Read / Write

How much to reduce high-frequency resolution (by increasing quantisation).

Allowed values: [0,2]

Default value: 0


The "reduction-2x2" property

  "reduction-2x2"            gint                  : Read / Write

Reduction factor for 2x2 subsampled candidate motion estimates (1=max. quality, 4=max. speed).

Allowed values: [1,4]

Default value: 3


The "reduction-4x4" property

  "reduction-4x4"            gint                  : Read / Write

Reduction factor for 4x4 subsampled candidate motion estimates (1=max. quality, 4=max. speed).

Allowed values: [1,4]

Default value: 2


The "sequence-header-every-gop" property

  "sequence-header-every-gop" gboolean              : Read / Write

Include a sequence header in every GOP.

Default value: FALSE


The "sequence-length" property

  "sequence-length"          gint                  : Read / Write

Place a sequence boundary after each <num> MB (0=disable).

Allowed values: [0,10240]

Default value: 0


The "unit-coeff-elim" property

  "unit-coeff-elim"          gint                  : Read / Write

How agressively small-unit picture blocks should be skipped.

Allowed values: [-40,40]

Default value: 0


The "vcd-still-size" property

  "vcd-still-size"           gint                  : Read / Write

Size of VCD stills (in KB).

Allowed values: [0,512]

Default value: 0

See Also

mpeg2dec