# GstH264BitWriter

## Functions

### gst_h264_bit_writer_aud

    GstH264BitWriterResult
    gst_h264_bit_writer_aud (guint8 primary_pic_type,
                             gboolean start_code,
                             guint8 * data,
                             guint * size)

Generating the according h264 bit stream of an aud.

Parameters:

`primary_pic_type` –

indicate the possible slice types list just as the H264 spec defines

`start_code` –

whether adding the nal start code

`data` ( [out]) –

the bit stream generated by the aud

`size` ( [inout]) –

the size in bytes of the input and output

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_aud

    function GstCodecParsers.prototype.h264_bit_writer_aud(primary_pic_type: Number, start_code: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_aud'
    }

Generating the according h264 bit stream of an aud.

Parameters:

`primary_pic_type` (Number) –

indicate the possible slice types list just as the H264 spec defines

`start_code` (Number) –

whether adding the nal start code

`size` (Number) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_aud

    def GstCodecParsers.h264_bit_writer_aud (primary_pic_type, start_code, size):
        #python wrapper for 'gst_h264_bit_writer_aud'

Generating the according h264 bit stream of an aud.

Parameters:

`primary_pic_type` (int) –

indicate the possible slice types list just as the H264 spec defines

`start_code` (bool) –

whether adding the nal start code

`size` (int) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### gst_h264_bit_writer_convert_to_nal

    GstH264BitWriterResult
    gst_h264_bit_writer_convert_to_nal (guint nal_prefix_size,
                                        gboolean packetized,
                                        gboolean has_startcode,
                                        gboolean add_trailings,
                                        const guint8 * raw_data,
                                        gsize raw_size,
                                        guint8 * nal_data,
                                        guint * nal_size)

Converting a bit stream into a real nal packet. If the bit stream already has a start code, it will be replaced by the new one specified by the nal_prefix_size and packetized. It is assured that the output aligns to the byte and the all the emulations are inserted.

Parameters:

`nal_prefix_size` –

the size in bytes for the prefix of a nal, may be 2, 3 or 4

`packetized` –

whether to write the bit stream in packetized format, which does not have the start code but has a nal_prefix_size bytes' size prepending to the real nal data

`has_startcode` –

whether the input already has a start code

`add_trailings` –

whether to add rbsp trailing bits to make the output aligned to byte

`raw_data` –

the input bit stream

`raw_size` –

the size in bits of the input bit stream

`nal_data` ( [out]) –

the output bit stream converted to a real nal

`nal_size` ( [inout]) –

the size in bytes of the output

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_convert_to_nal

    function GstCodecParsers.prototype.h264_bit_writer_convert_to_nal(nal_prefix_size: Number, packetized: Number, has_startcode: Number, add_trailings: Number, raw_data: Number, raw_size: Number, nal_size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_convert_to_nal'
    }

Converting a bit stream into a real nal packet. If the bit stream already has a start code, it will be replaced by the new one specified by the nal_prefix_size and packetized. It is assured that the output aligns to the byte and the all the emulations are inserted.

Parameters:

`nal_prefix_size` (Number) –

the size in bytes for the prefix of a nal, may be 2, 3 or 4

`packetized` (Number) –

whether to write the bit stream in packetized format, which does not have the start code but has a nal_prefix_size bytes' size prepending to the real nal data

`has_startcode` (Number) –

whether the input already has a start code

`add_trailings` (Number) –

whether to add rbsp trailing bits to make the output aligned to byte

`raw_data` (Number) –

the input bit stream

`raw_size` (Number) –

the size in bits of the input bit stream

`nal_size` (Number) –

the size in bytes of the output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`nal_data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`nal_size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_convert_to_nal

    def GstCodecParsers.h264_bit_writer_convert_to_nal (nal_prefix_size, packetized, has_startcode, add_trailings, raw_data, raw_size, nal_size):
        #python wrapper for 'gst_h264_bit_writer_convert_to_nal'

Converting a bit stream into a real nal packet. If the bit stream already has a start code, it will be replaced by the new one specified by the nal_prefix_size and packetized. It is assured that the output aligns to the byte and the all the emulations are inserted.

Parameters:

`nal_prefix_size` (int) –

the size in bytes for the prefix of a nal, may be 2, 3 or 4

`packetized` (bool) –

whether to write the bit stream in packetized format, which does not have the start code but has a nal_prefix_size bytes' size prepending to the real nal data

`has_startcode` (bool) –

whether the input already has a start code

`add_trailings` (bool) –

whether to add rbsp trailing bits to make the output aligned to byte

`raw_data` (int) –

the input bit stream

`raw_size` (int) –

the size in bits of the input bit stream

`nal_size` (int) –

the size in bytes of the output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`nal_data` (int ) –

a GstCodecParsers.H264BitWriterResult

`nal_size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### gst_h264_bit_writer_filler

    GstH264BitWriterResult
    gst_h264_bit_writer_filler (gboolean start_code,
                                guint num,
                                guint8 * data,
                                guint * size)

Generates the according h264 bit stream nal bitstream of a filler with size.

Parameters:

`start_code` –

whether adding the nal start code

`num` –

number of filler codes to add

`data` ( [inout]) –

bit stream storage

`size` ( [inout]) –

size in bytes of the input and output

Returns –

a GstH264BitWriterResult

Since : 1.26

### GstCodecParsers.prototype.h264_bit_writer_filler

    function GstCodecParsers.prototype.h264_bit_writer_filler(start_code: Number, num: Number, data: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_filler'
    }

Generates the according h264 bit stream nal bitstream of a filler with size.

Parameters:

`start_code` (Number) –

whether adding the nal start code

`num` (Number) –

number of filler codes to add

`data` (Number) –

bit stream storage

`size` (Number) –

size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.26

### GstCodecParsers.h264_bit_writer_filler

    def GstCodecParsers.h264_bit_writer_filler (start_code, num, data, size):
        #python wrapper for 'gst_h264_bit_writer_filler'

Generates the according h264 bit stream nal bitstream of a filler with size.

Parameters:

`start_code` (bool) –

whether adding the nal start code

`num` (int) –

number of filler codes to add

`data` (int) –

bit stream storage

`size` (int) –

size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.26

### gst_h264_bit_writer_pps

    GstH264BitWriterResult
    gst_h264_bit_writer_pps (const GstH264PPS * pps,
                             gboolean start_code,
                             guint8 * data,
                             guint * size)

Generating the according h264 bit stream by providing the pps.

Parameters:

`pps` –

the pps of GstH264PPS to write

`start_code` –

whether adding the nal start code

`data` ( [out]) –

the bit stream generated by the pps

`size` ( [inout]) –

the size in bytes of the input and output

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_pps

    function GstCodecParsers.prototype.h264_bit_writer_pps(pps: GstCodecParsers.H264PPS, start_code: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_pps'
    }

Generating the according h264 bit stream by providing the pps.

Parameters:

`pps` (GstCodecParsers.H264PPS) –

the pps of GstCodecParsers.H264PPS to write

`start_code` (Number) –

whether adding the nal start code

`size` (Number) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_pps

    def GstCodecParsers.h264_bit_writer_pps (pps, start_code, size):
        #python wrapper for 'gst_h264_bit_writer_pps'

Generating the according h264 bit stream by providing the pps.

Parameters:

`pps` (GstCodecParsers.H264PPS) –

the pps of GstCodecParsers.H264PPS to write

`start_code` (bool) –

whether adding the nal start code

`size` (int) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### gst_h264_bit_writer_sei

    GstH264BitWriterResult
    gst_h264_bit_writer_sei (GArray * sei_messages,
                             gboolean start_code,
                             guint8 * data,
                             guint * size)

Generating the according h264 bit stream by providing sei messages.

Parameters:

`sei_messages` ( [element-type GstH264SEIMessage]) –

An array of GstH264SEIMessage to write

`start_code` –

whether adding the nal start code

`data` ( [out]) –

the bit stream generated by the sei messages

`size` ( [inout]) –

the size in bytes of the input and output

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_sei

    function GstCodecParsers.prototype.h264_bit_writer_sei(sei_messages: [ GstCodecParsers.H264SEIMessage ], start_code: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_sei'
    }

Generating the according h264 bit stream by providing sei messages.

Parameters:

`sei_messages` ([ GstCodecParsers.H264SEIMessage ]) –

An array of GstCodecParsers.H264SEIMessage to write

`start_code` (Number) –

whether adding the nal start code

`size` (Number) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_sei

    def GstCodecParsers.h264_bit_writer_sei (sei_messages, start_code, size):
        #python wrapper for 'gst_h264_bit_writer_sei'

Generating the according h264 bit stream by providing sei messages.

Parameters:

`sei_messages` ([ GstCodecParsers.H264SEIMessage ]) –

An array of GstCodecParsers.H264SEIMessage to write

`start_code` (bool) –

whether adding the nal start code

`size` (int) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### gst_h264_bit_writer_slice_hdr

    GstH264BitWriterResult
    gst_h264_bit_writer_slice_hdr (const GstH264SliceHdr * slice,
                                   gboolean start_code,
                                   GstH264NalUnitType nal_type,
                                   gboolean is_ref,
                                   guint8 * data,
                                   guint * size,
                                   guint * trail_bits_num)

Generating the according h264 bit stream by providing the slice header.

Parameters:

`slice` –

the slice header of GstH264SliceHdr to write

`start_code` –

whether adding the nal start code

`nal_type` –

the slice's nal type of GstH264NalUnitType

`is_ref` –

whether the slice is a reference

`data` ( [out]) –

the bit stream generated by the slice header

`size` ( [inout]) –

the size in bytes of the input and output

`trail_bits_num` ( [out]) –

the trail bits number which is not byte aligned.

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_slice_hdr

    function GstCodecParsers.prototype.h264_bit_writer_slice_hdr(slice: GstCodecParsers.H264SliceHdr, start_code: Number, nal_type: GstCodecParsers.H264NalUnitType, is_ref: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_slice_hdr'
    }

Generating the according h264 bit stream by providing the slice header.

Parameters:

`slice` (GstCodecParsers.H264SliceHdr) –

the slice header of GstCodecParsers.H264SliceHdr to write

`start_code` (Number) –

whether adding the nal start code

`nal_type` (GstCodecParsers.H264NalUnitType) –

the slice's nal type of GstCodecParsers.H264NalUnitType

`is_ref` (Number) –

whether the slice is a reference

`size` (Number) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

`trail_bits_num` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_slice_hdr

    def GstCodecParsers.h264_bit_writer_slice_hdr (slice, start_code, nal_type, is_ref, size):
        #python wrapper for 'gst_h264_bit_writer_slice_hdr'

Generating the according h264 bit stream by providing the slice header.

Parameters:

`slice` (GstCodecParsers.H264SliceHdr) –

the slice header of GstCodecParsers.H264SliceHdr to write

`start_code` (bool) –

whether adding the nal start code

`nal_type` (GstCodecParsers.H264NalUnitType) –

the slice's nal type of GstCodecParsers.H264NalUnitType

`is_ref` (bool) –

whether the slice is a reference

`size` (int) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

`trail_bits_num` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### gst_h264_bit_writer_sps

    GstH264BitWriterResult
    gst_h264_bit_writer_sps (const GstH264SPS * sps,
                             gboolean start_code,
                             guint8 * data,
                             guint * size)

Generating the according h264 bit stream by providing the sps.

Parameters:

`sps` –

the sps of GstH264SPS to write

`start_code` –

whether adding the nal start code

`data` ( [out]) –

the bit stream generated by the sps

`size` ( [inout]) –

the size in bytes of the input and output

Returns –

a GstH264BitWriterResult

Since : 1.22

### GstCodecParsers.prototype.h264_bit_writer_sps

    function GstCodecParsers.prototype.h264_bit_writer_sps(sps: GstCodecParsers.H264SPS, start_code: Number, size: Number): {
        // javascript wrapper for 'gst_h264_bit_writer_sps'
    }

Generating the according h264 bit stream by providing the sps.

Parameters:

`sps` (GstCodecParsers.H264SPS) –

the sps of GstCodecParsers.H264SPS to write

`start_code` (Number) –

whether adding the nal start code

`size` (Number) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (Number ) –

a GstCodecParsers.H264BitWriterResult

`size` (Number ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

### GstCodecParsers.h264_bit_writer_sps

    def GstCodecParsers.h264_bit_writer_sps (sps, start_code, size):
        #python wrapper for 'gst_h264_bit_writer_sps'

Generating the according h264 bit stream by providing the sps.

Parameters:

`sps` (GstCodecParsers.H264SPS) –

the sps of GstCodecParsers.H264SPS to write

`start_code` (bool) –

whether adding the nal start code

`size` (int) –

the size in bytes of the input and output

Returns a tuple made of:

(GstCodecParsers.H264BitWriterResult ) –

a GstCodecParsers.H264BitWriterResult

`data` (int ) –

a GstCodecParsers.H264BitWriterResult

`size` (int ) –

a GstCodecParsers.H264BitWriterResult

Since : 1.22

## Enumerations

### GstH264BitWriterResult

The result of writing H264 data into bit stream.

##### Members

`GST_H264_BIT_WRITER_OK` (0) –

The writing succeeded

`GST_H264_BIT_WRITER_INVALID_DATA` (1) –

The input data to write is invalid

`GST_H264_BIT_WRITER_NO_MORE_SPACE` (2) –

The output does not have enough size

`GST_H264_BIT_WRITER_ERROR` (3) –

An general error occurred when writing

Since : 1.22

### GstCodecParsers.H264BitWriterResult

The result of writing H264 data into bit stream.

##### Members

`GstCodecParsers.H264BitWriterResult.OK` (0) –

The writing succeeded

`GstCodecParsers.H264BitWriterResult.INVALID_DATA` (1) –

The input data to write is invalid

`GstCodecParsers.H264BitWriterResult.NO_MORE_SPACE` (2) –

The output does not have enough size

`GstCodecParsers.H264BitWriterResult.ERROR` (3) –

An general error occurred when writing

Since : 1.22

### GstCodecParsers.H264BitWriterResult

The result of writing H264 data into bit stream.

##### Members

`GstCodecParsers.H264BitWriterResult.OK` (0) –

The writing succeeded

`GstCodecParsers.H264BitWriterResult.INVALID_DATA` (1) –

The input data to write is invalid

`GstCodecParsers.H264BitWriterResult.NO_MORE_SPACE` (2) –

The output does not have enough size

`GstCodecParsers.H264BitWriterResult.ERROR` (3) –

An general error occurred when writing

Since : 1.22

The results of the search are