x264enc

x264enc — H264 Encoder

Synopsis

                    GstX264Enc;

Description

This element encodes raw video into H264 compressed data, also otherwise known as MPEG-4 AVC (Advanced Video Codec).

The "pass" property controls the type of encoding. In case of Constant Bitrate Encoding (actually ABR), the "bitrate" will determine the quality of the encoding. This will similarly be the case if this target bitrate is to obtained in multiple (2 or 3) pass encoding. Alternatively, one may choose to perform Constant Quantizer or Quality encoding, in which case the "quantizer" property controls much of the outcome.

The H264 profile that is eventually used depends on a few settings. If "dct8x8" is enabled, then High profile is used. Otherwise, if "cabac" entropy coding is enabled or "bframes" are allowed, then Main Profile is in effect, and otherwise Baseline profile applies. As such, Main is presently the default profile, which is fine for most players and settings, but in some cases (e.g. hardware platforms) a more restricted profile/level may be necessary.

Example pipeline

gst-launch -v videotestsrc num-buffers=1000 ! x264enc qp-min=18 ! \
  avimux ! filesink location=videotestsrc.avi
This example pipeline will encode a test video source to H264 muxed in an AVI container, while ensuring a sane minimum quantization factor to avoid some (excessive) waste.
gst-launch -v videotestsrc num-buffers=1000 ! x264enc pass=quant ! \
  matroskamux ! filesink location=videotestsrc.avi
This example pipeline will encode a test video source to H264 using fixed quantization, and muxes it in a Matroska container.

Synopsis

Element Information

plugin

x264

author

Josef Zlomek <josef.zlomek@itonis.tv>, Mark Nauwelaerts <mnauw@users.sf.net>

class

Codec/Encoder/Video

Element Pads

name

sink

direction

sink

presence

always

details

video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 16, 2147483647 ], height=(int)[ 16, 2147483647 ]

name

src

direction

source

presence

always

details

video/x-h264, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]

Details

GstX264Enc

typedef struct {
  GstElement element;
} GstX264Enc;

See Also

faac