Functions

av1_bit_writer_frame_header_obu (frame_hdr, seq_hdr, temporal_id, spatial_id, size_field, size)

av1_bit_writer_frame_header_obu_with_offsets (frame_hdr, seq_hdr, temporal_id, spatial_id, size_field, size_field_size, size)

av1_bit_writer_metadata_obu (metadata, temporal_id, spatial_id, size_field, size)

av1_bit_writer_sequence_header_obu (seq_hdr, size_field, size)

av1_bit_writer_temporal_delimiter_obu (size_field, size)

buffer_add_lcevc_meta (buffer, enhancement_data)

buffer_add_mpeg_video_meta (buffer, seq_hdr, seq_ext, disp_ext, pic_hdr, pic_ext, quant_ext)

buffer_get_lcevc_meta (buffer)

buffer_get_lcevc_meta_id (buffer, id)

h263_parse (packet, data, offset, size)

h264_bit_writer_aud (primary_pic_type, start_code, size)

h264_bit_writer_convert_to_nal (nal_prefix_size, packetized, has_startcode, add_trailings, raw_data, raw_size, nal_size)

h264_bit_writer_filler (start_code, num, data, size)

h264_bit_writer_pps (pps, start_code, size)

h264_bit_writer_sei (sei_messages, start_code, size)

h264_bit_writer_slice_hdr (slice, start_code, nal_type, is_ref, size)

h264_bit_writer_sps (sps, start_code, size)

h264_create_sei_memory (start_code_prefix_length, messages)

h264_create_sei_memory_avc (nal_length_size, messages)

h264_parse_pps (nalparser, nalu, pps)

h264_parse_sps (nalu, sps)

h264_parse_subset_sps (nalu, sps)

h264_parser_identify_and_split_nalu_avc (nalparser, data, offset, size, nal_length_size, nalus)

h264_parser_identify_nalu (nalparser, data, offset, size, nalu)

h264_parser_identify_nalu_avc (nalparser, data, offset, size, nal_length_size, nalu)

h264_parser_identify_nalu_unchecked (nalparser, data, offset, size, nalu)

h264_parser_insert_sei (nalparser, au, sei)

h264_parser_insert_sei_avc (nalparser, nal_length_size, au, sei)

h264_parser_parse_decoder_config_record (nalparser, data, size)

h264_parser_parse_nal (nalparser, nalu)

h264_parser_parse_pps (nalparser, nalu, pps)

h264_parser_parse_sei (nalparser, nalu, messages)

h264_parser_parse_slice_hdr (nalparser, nalu, slice, parse_pred_weight_table, parse_dec_ref_pic_marking)

h264_parser_parse_sps (nalparser, nalu, sps)

h264_parser_parse_subset_sps (nalparser, nalu, sps)

h264_parser_update_pps (nalparser, pps)

h264_parser_update_sps (nalparser, sps)

h264_profile_from_string (profile)

h264_quant_matrix_4x4_get_raster_from_zigzag (quant)

h264_quant_matrix_4x4_get_zigzag_from_raster (quant)

h264_quant_matrix_8x8_get_raster_from_zigzag (quant)

h264_quant_matrix_8x8_get_zigzag_from_raster (quant)

h264_sei_clear (sei)

h264_slice_type_to_string (slice_type)

h264_video_calculate_framerate (sps, field_pic_flag, pic_struct)

h265_create_sei_memory (layer_id, temporal_id_plus1, start_code_prefix_length, messages)

h265_create_sei_memory_hevc (layer_id, temporal_id_plus1, nal_length_size, messages)

h265_get_profile_from_sps (sps)

h265_parse_pps (parser, nalu, pps)

h265_parse_sps (parser, nalu, sps, parse_vui_params)

h265_parse_sps_ext (parser, nalu, sps, sps_ext, parse_vui_params)

h265_parse_vps (nalu, vps)

h265_profile_from_string (string)

h265_profile_to_string (profile)

h265_quant_matrix_4x4_get_raster_from_uprightdiagonal (quant)

h265_quant_matrix_4x4_get_raster_from_zigzag (quant)

h265_quant_matrix_4x4_get_uprightdiagonal_from_raster (quant)

h265_quant_matrix_4x4_get_zigzag_from_raster (quant)

h265_quant_matrix_8x8_get_raster_from_uprightdiagonal (quant)

h265_quant_matrix_8x8_get_raster_from_zigzag (quant)

h265_quant_matrix_8x8_get_uprightdiagonal_from_raster (quant)

h265_quant_matrix_8x8_get_zigzag_from_raster (quant)

h265_sei_copy (dest_sei, src_sei)

h265_sei_free (sei)

h265_slice_type_to_string (slice_type)

h266_parse_aps (parser, nalu, aps)

h266_parse_pps (parser, nalu, pps)

h266_parse_sps (parser, nalu, sps)

h266_parse_vps (nalu, vps)

h266_profile_from_string (string)

h266_profile_to_string (profile)

jpeg2000_colorspace_from_string (colorspace_string)

jpeg2000_colorspace_to_string (colorspace)

jpeg2000_sampling_from_string (sampling_string)

jpeg2000_sampling_is_mono (sampling)

jpeg2000_sampling_is_rgb (sampling)

jpeg2000_sampling_is_yuv (sampling)

jpeg2000_sampling_to_string (sampling)

jpeg_bit_writer_frame_header (frame_hdr, marker, size)

jpeg_bit_writer_huffman_table (huff_tables, size)

jpeg_bit_writer_quantization_table (quant_tables, size)

jpeg_bit_writer_restart_interval (interval, size)

jpeg_bit_writer_scan_header (scan_hdr, size)

jpeg_bit_writer_segment_with_data (marker, seg_data, seg_size, size)

jpeg_get_default_huffman_tables ()

jpeg_get_default_quantization_tables (quant_tables)

jpeg_parse (data, size, offset)

lcevc_meta_api_get_type ()

lcevc_meta_get_info ()

mpeg4_parse (packet, skip_user_data, vop, data, offset, size)

mpeg4_parse_group_of_vop (gov, data, size)

mpeg4_parse_video_object_layer (vol, vo, data, size)

mpeg4_parse_video_object_plane (vop, sprite_trajectory, vol, data, size)

mpeg4_parse_video_packet_header (videopackethdr, vol, vop, sprite_trajectory, data, size)

mpeg4_parse_video_plane_short_header (shorthdr, data, size)

mpeg4_parse_visual_object (vo, signal_type, data, size)

mpeg4_parse_visual_object_sequence (vos, data, size)

mpeg_video_finalise_mpeg2_sequence_header (hdr, seqext, displayext)

mpeg_video_meta_api_get_type ()

mpeg_video_meta_get_info ()

mpeg_video_parse (packet, data, size, offset)

mpeg_video_quant_matrix_get_raster_from_zigzag (quant)

mpeg_video_quant_matrix_get_zigzag_from_raster (quant)

vc1_bitplanes_ensure_size (bitplanes, seqhdr)

vc1_bitplanes_free (bitplanes)

vc1_bitplanes_free_1 (bitplanes)

vc1_identify_next_bdu (data, size)

vc1_parse_entry_point_header (data, size, seqhdr)

vc1_parse_field_header (data, size, fieldhdr, seqhdr, bitplanes)

vc1_parse_frame_header (data, size, framehdr, seqhdr, bitplanes)

vc1_parse_frame_layer (data, size, framelayer)

vc1_parse_sequence_header (data, size, seqhdr)

vc1_parse_sequence_header_struct_a (data, size, structa)

vc1_parse_sequence_header_struct_b (data, size, structb)

vc1_parse_sequence_header_struct_c (data, size, structc)

vc1_parse_sequence_layer (data, size, seqlayer)

vc1_parse_slice_header (data, size, slicehdr, seqhdr)

Details

GstCodecParsers.av1_bit_writer_frame_header_obu(frame_hdr, seq_hdr, temporal_id, spatial_id, size_field, size)
Parameters:
Returns:

a GstCodecParsers.AV1BitWriterResult

data:

the bit stream generated by the frame header

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.AV1BitWriterResult, data: int, size: int)

Generating the according AV1 bit stream OBU by providing the frame header.

New in version 1.22.

GstCodecParsers.av1_bit_writer_frame_header_obu_with_offsets(frame_hdr, seq_hdr, temporal_id, spatial_id, size_field, size_field_size, size)
Parameters:
Returns:

a GstCodecParsers.AV1BitWriterResult

qindex_offset:

return the qindex fields offset in bits.

segmentation_offset:

return the segmentation fields offset in bits.

lf_offset:

return the loopfilter fields offset in bits.

cdef_offset:

return the cdef fields offset in bits.

cdef_size:

return the cdef fields size in bits.

data:

the bit stream generated by the frame header

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.AV1BitWriterResult, qindex_offset: int, segmentation_offset: int, lf_offset: int, cdef_offset: int, cdef_size: int, data: int, size: int)

While Generating the according AV1 bit stream OBU by providing the frame header, this function also return bit offsets of qindex, segmentation and cdef, etc. These offsets can help to change the content of these fields later. This function is useful if the encoder may change the content of the frame header after generating it. For example, some HW needs user to provide a frame header before the real encoding job, and it will change the according fields in the frame header during the real encoding job.

New in version 1.22.

GstCodecParsers.av1_bit_writer_metadata_obu(metadata, temporal_id, spatial_id, size_field, size)
Parameters:
  • metadata (GstCodecParsers.AV1MetadataOBU) – the meta data of GstCodecParsers.AV1MetadataOBU to write

  • temporal_id (int) – specifies the temporal level of the data contained in the OBU.

  • spatial_id (int) – specifies the spatial level of the data contained in the OBU.

  • size_field (bool) – whether the header contain size feild

  • size (int) – the size in bytes of the input and output

Returns:

a GstCodecParsers.AV1BitWriterResult

data:

the bit stream generated by the meta data

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.AV1BitWriterResult, data: int, size: int)

Generating the according AV1 bit stream OBU by providing the meta data.

New in version 1.22.

GstCodecParsers.av1_bit_writer_sequence_header_obu(seq_hdr, size_field, size)
Parameters:
Returns:

a GstCodecParsers.AV1BitWriterResult

data:

the bit stream generated by the sequence header

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.AV1BitWriterResult, data: int, size: int)

Generating the according AV1 bit stream OBU by providing the sequence header.

New in version 1.22.

GstCodecParsers.av1_bit_writer_temporal_delimiter_obu(size_field, size)
Parameters:
  • size_field (bool) – whether the header contain size feild

  • size (int) – the size in bytes of the input and output

Returns:

a GstCodecParsers.AV1BitWriterResult

data:

the bit stream generated

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.AV1BitWriterResult, data: int, size: int)

Generating the according temporal delimiter AV1 bit stream OBU.

New in version 1.22.

GstCodecParsers.buffer_add_lcevc_meta(buffer, enhancement_data)
Parameters:
Returns:

the GstCodecParsers.LcevcMeta on buffer.

Return type:

GstCodecParsers.LcevcMeta

Attaches GstCodecParsers.LcevcMeta metadata to buffer.

New in version 1.26.

GstCodecParsers.buffer_add_mpeg_video_meta(buffer, seq_hdr, seq_ext, disp_ext, pic_hdr, pic_ext, quant_ext)
Parameters:
Returns:

a newly created GstCodecParsers.MpegVideoMeta

Return type:

GstCodecParsers.MpegVideoMeta

Creates and adds a GstCodecParsers.MpegVideoMeta to a buffer. Provided structures must either be None or GSlice-allocated.

New in version 1.2.

GstCodecParsers.buffer_get_lcevc_meta(buffer)
Parameters:

buffer (Gst.Buffer) – a Gst.Buffer

Returns:

the GstCodecParsers.LcevcMeta with lowest id (usually 0) or None when there is no such metadata on buffer.

Return type:

GstCodecParsers.LcevcMeta or None

Find the GstCodecParsers.LcevcMeta on buffer with the lowest id.

Buffers can contain multiple GstCodecParsers.LcevcMeta metadata items when dealing with multiview buffers.

New in version 1.26.

GstCodecParsers.buffer_get_lcevc_meta_id(buffer, id)
Parameters:
Returns:

the GstCodecParsers.LcevcMeta with id or None when there is no such metadata on buffer.

Return type:

GstCodecParsers.LcevcMeta or None

Find the GstCodecParsers.LcevcMeta on buffer with the given id.

Buffers can contain multiple GstCodecParsers.LcevcMeta metadata items when dealing with multiview buffers.

New in version 1.26.

GstCodecParsers.h263_parse(packet, data, offset, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data and fills packet with the information of the next packet found.

Note that the type of the packet is meaningless in this case.

GstCodecParsers.h264_bit_writer_aud(primary_pic_type, start_code, size)
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 GstCodecParsers.H264BitWriterResult

data:

the bit stream generated by the aud

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int)

Generating the according h264 bit stream of an aud.

New in version 1.22.

GstCodecParsers.h264_bit_writer_convert_to_nal(nal_prefix_size, packetized, has_startcode, add_trailings, raw_data, raw_size, nal_size)
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 GstCodecParsers.H264BitWriterResult

nal_data:

the output bit stream converted to a real nal

nal_size:

the size in bytes of the output

Return type:

(GstCodecParsers.H264BitWriterResult, nal_data: int, nal_size: int)

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.

New in version 1.22.

GstCodecParsers.h264_bit_writer_filler(start_code, num, data, 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 GstCodecParsers.H264BitWriterResult

data:

bit stream storage

size:

size in bytes of the input and output

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int)

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

New in version 1.26.

GstCodecParsers.h264_bit_writer_pps(pps, start_code, size)
Parameters:
Returns:

a GstCodecParsers.H264BitWriterResult

data:

the bit stream generated by the pps

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int)

Generating the according h264 bit stream by providing the pps.

New in version 1.22.

GstCodecParsers.h264_bit_writer_sei(sei_messages, start_code, size)
Parameters:
Returns:

a GstCodecParsers.H264BitWriterResult

data:

the bit stream generated by the sei messages

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int)

Generating the according h264 bit stream by providing sei messages.

New in version 1.22.

GstCodecParsers.h264_bit_writer_slice_hdr(slice, start_code, nal_type, is_ref, size)
Parameters:
Returns:

a GstCodecParsers.H264BitWriterResult

data:

the bit stream generated by the slice header

size:

the size in bytes of the input and output

trail_bits_num:

the trail bits number which is not byte aligned.

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int, trail_bits_num: int)

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

New in version 1.22.

GstCodecParsers.h264_bit_writer_sps(sps, start_code, size)
Parameters:
Returns:

a GstCodecParsers.H264BitWriterResult

data:

the bit stream generated by the sps

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.H264BitWriterResult, data: int, size: int)

Generating the according h264 bit stream by providing the sps.

New in version 1.22.

GstCodecParsers.h264_create_sei_memory(start_code_prefix_length, messages)
Parameters:
Returns:

a Gst.Memory containing a SEI nal unit

Return type:

Gst.Memory

Creates raw byte-stream format (a.k.a Annex B type) SEI nal unit data from messages

New in version 1.18.

GstCodecParsers.h264_create_sei_memory_avc(nal_length_size, messages)
Parameters:
Returns:

a Gst.Memory containing a SEI nal unit

Return type:

Gst.Memory

Creates raw packetized format SEI nal unit data from messages

New in version 1.18.

GstCodecParsers.h264_parse_pps(nalparser, nalu, pps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses data, and fills the pps structure.

The resulting pps data structure shall be deallocated with the GstCodecParsers.H264PPS.clear() function when it is no longer needed, or prior to parsing a new PPS NAL unit.

GstCodecParsers.h264_parse_sps(nalu, sps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses data, and fills the sps structure.

GstCodecParsers.h264_parse_subset_sps(nalu, sps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses data, and fills in the sps structure.

This function fully parses data and allocates all the necessary data structures needed for MVC extensions. The resulting sps structure shall be deallocated with GstCodecParsers.H264SPS.clear() when it is no longer needed.

Note: if the caller doesn’t need any of the MVC-specific data, then GstCodecParsers.h264_parser_parse_sps() is more efficient because those extra syntax elements are not parsed and no extra memory is allocated.

New in version 1.6.

GstCodecParsers.h264_parser_identify_and_split_nalu_avc(nalparser, data, offset, size, nal_length_size, nalus)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

consumed:

the size of consumed bytes

Return type:

(GstCodecParsers.H264ParserResult, consumed: int)

Parses data for packetized (e.g., avc/avc3) bitstream and sets nalus. In addition to nal identifying process, this method scans start-code prefix to split malformed packet into actual nal chunks.

New in version 1.22.9.

GstCodecParsers.h264_parser_identify_nalu(nalparser, data, offset, size, nalu)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses the headers of an Annex B coded NAL unit from data and puts the result into nalu.

GstCodecParsers.h264_parser_identify_nalu_avc(nalparser, data, offset, size, nal_length_size, nalu)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses the headers of an AVC coded NAL unit from data and puts the result into nalu.

GstCodecParsers.h264_parser_identify_nalu_unchecked(nalparser, data, offset, size, nalu)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses data and fills nalu from the next nalu data from data.

This differs from gst_h264_parser_identify_nalu in that it doesn’t check whether the packet is complete or not.

Note: Only use this function if you already know the provided data is a complete NALU, else use gst_h264_parser_identify_nalu.

GstCodecParsers.h264_parser_insert_sei(nalparser, au, sei)
Parameters:
Returns:

a SEI inserted Gst.Buffer or None if cannot figure out proper position to insert a sei

Return type:

Gst.Buffer or None

Copy au into new Gst.Buffer and insert sei into the Gst.Buffer. The validation for completeness of au and sei is caller’s responsibility. Both au and sei must be byte-stream formatted

New in version 1.18.

GstCodecParsers.h264_parser_insert_sei_avc(nalparser, nal_length_size, au, sei)
Parameters:
Returns:

a SEI inserted Gst.Buffer or None if cannot figure out proper position to insert a sei

Return type:

Gst.Buffer or None

Copy au into new Gst.Buffer and insert sei into the Gst.Buffer. The validation for completeness of au and sei is caller’s responsibility. Nal prefix type of both au and sei must be packetized, and also the size of nal length field must be identical to nal_length_size

New in version 1.18.

GstCodecParsers.h264_parser_parse_decoder_config_record(nalparser, data, size)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

config:

parsed GstCodecParsers.H264DecoderConfigRecord data

Return type:

(GstCodecParsers.H264ParserResult, config: GstCodecParsers.H264DecoderConfigRecord)

Parses AVCDecoderConfigurationRecord data and fill into config. The caller must free config via GstCodecParsers.H264DecoderConfigRecord.free()

This method does not parse SPS and PPS and therefore the caller needs to parse each NAL unit via appropriate parsing method.

New in version 1.22.

GstCodecParsers.h264_parser_parse_nal(nalparser, nalu)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

This function should be called in the case one doesn’t need to parse a specific structure. It is necessary to do so to make sure nalparser is up to date.

GstCodecParsers.h264_parser_parse_pps(nalparser, nalu, pps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses nalu containing a Picture Parameter Set, and fills pps.

The resulting pps data structure must be deallocated by the caller using GstCodecParsers.H264PPS.clear().

GstCodecParsers.h264_parser_parse_sei(nalparser, nalu, messages)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses nalu containing one or more Supplementary Enhancement Information messages, and allocates and fills the messages array.

GstCodecParsers.h264_parser_parse_slice_hdr(nalparser, nalu, slice, parse_pred_weight_table, parse_dec_ref_pic_marking)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses nalu containing a coded slice, and fills slice.

GstCodecParsers.h264_parser_parse_sps(nalparser, nalu, sps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses nalu containing a Sequence Parameter Set, and fills sps.

GstCodecParsers.h264_parser_parse_subset_sps(nalparser, nalu, sps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Parses data, and fills in the sps structure.

This function fully parses data and allocates all the necessary data structures needed for MVC extensions. The resulting sps structure shall be deallocated with GstCodecParsers.H264SPS.clear() when it is no longer needed.

Note: if the caller doesn’t need any of the MVC-specific data, then GstCodecParsers.h264_parser_parse_sps() is more efficient because those extra syntax elements are not parsed and no extra memory is allocated.

New in version 1.6.

GstCodecParsers.h264_parser_update_pps(nalparser, pps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Replace internal Picture Parameter Set struct corresponding to id of pps with pps. nalparser will mark pps as last parsed pps.

New in version 1.18.

GstCodecParsers.h264_parser_update_sps(nalparser, sps)
Parameters:
Returns:

a GstCodecParsers.H264ParserResult

Return type:

GstCodecParsers.H264ParserResult

Replace internal Sequence Parameter Set struct corresponding to id of sps with sps. nalparser will mark sps as last parsed sps.

New in version 1.18.

GstCodecParsers.h264_profile_from_string(profile)
Parameters:

profile (str) – the descriptive name for GstCodecParsers.H264Profile

Returns:

the GstCodecParsers.H264Profile of string or GstCodecParsers.H265Profile.INVALID on error

Return type:

GstCodecParsers.H264Profile

Returns a GstCodecParsers.H264Profile for the string.

New in version 1.24.

GstCodecParsers.h264_quant_matrix_4x4_get_raster_from_zigzag(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from zigzag scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.4.

GstCodecParsers.h264_quant_matrix_4x4_get_zigzag_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to zigzag scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.4.

GstCodecParsers.h264_quant_matrix_8x8_get_raster_from_zigzag(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from zigzag scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.4.

GstCodecParsers.h264_quant_matrix_8x8_get_zigzag_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to zigzag scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.4.

GstCodecParsers.h264_sei_clear(sei)
Parameters:

sei (GstCodecParsers.H264SEIMessage) –

sei: The GstCodecParsers.H264SEIMessage to clear Frees allocated data in sei if any.

New in version 1.18.

GstCodecParsers.h264_slice_type_to_string(slice_type)
Parameters:

slice_type (GstCodecParsers.H264SliceType) – a GstCodecParsers.H264SliceType

Returns:

the name for slice_type or None on error

Return type:

str or None

Returns the descriptive name for the GstCodecParsers.H264SliceType.

New in version 1.24.

GstCodecParsers.h264_video_calculate_framerate(sps, field_pic_flag, pic_struct)
Parameters:
  • sps (GstCodecParsers.H264SPS) – Current Sequence Parameter Set

  • field_pic_flag (int) – Current field_pic_flag, obtained from latest slice header

  • pic_struct (int) – pic_struct value if available, 0 otherwise

Returns:

fps_num:

The resulting fps numerator

fps_den:

The resulting fps denominator

Return type:

(fps_num: int, fps_den: int)

Calculate framerate of a video sequence using sps VUI information, field_pic_flag from a slice header and pic_struct from GstCodecParsers.H264PicTiming SEI message.

If framerate is variable or can’t be determined, fps_num will be set to 0 and fps_den to 1.

GstCodecParsers.h265_create_sei_memory(layer_id, temporal_id_plus1, start_code_prefix_length, messages)
Parameters:
Returns:

a Gst.Memory containing a PREFIX SEI nal unit

Return type:

Gst.Memory

Creates raw byte-stream format (a.k.a Annex B type) SEI nal unit data from messages

New in version 1.18.

GstCodecParsers.h265_create_sei_memory_hevc(layer_id, temporal_id_plus1, nal_length_size, messages)
Parameters:
Returns:

a Gst.Memory containing a PREFIX SEI nal unit

Return type:

Gst.Memory

Creates raw packetized format SEI nal unit data from messages

New in version 1.18.

GstCodecParsers.h265_get_profile_from_sps(sps)
Parameters:

sps (GstCodecParsers.H265SPS) – a GstCodecParsers.H265SPS

Returns:

a GstCodecParsers.H265Profile

Return type:

GstCodecParsers.H265Profile

Return the H265 profile from sps.

New in version 1.20.

GstCodecParsers.h265_parse_pps(parser, nalu, pps)
Parameters:
Returns:

a GstCodecParsers.H265ParserResult

Return type:

GstCodecParsers.H265ParserResult

Parses data, and fills the pps structure.

GstCodecParsers.h265_parse_sps(parser, nalu, sps, parse_vui_params)
Parameters:
Returns:

a GstCodecParsers.H265ParserResult

Return type:

GstCodecParsers.H265ParserResult

parser: The GstCodecParsers.H265Parser Parses data, and fills the sps structure.

GstCodecParsers.h265_parse_sps_ext(parser, nalu, sps, sps_ext, parse_vui_params)
Parameters:
Returns:

a GstCodecParsers.H265ParserResult

Return type:

GstCodecParsers.H265ParserResult

parser: The GstCodecParsers.H265Parser Parses data, and fills the sps structure.

New in version 1.28.

GstCodecParsers.h265_parse_vps(nalu, vps)
Parameters:
Returns:

a GstCodecParsers.H265ParserResult

Return type:

GstCodecParsers.H265ParserResult

Parses data, and fills the vps structure.

GstCodecParsers.h265_profile_from_string(string)
Parameters:

string (str) – the descriptive name for GstCodecParsers.H265Profile

Returns:

the GstCodecParsers.H265Profile of string or GstCodecParsers.H265Profile.INVALID on error

Return type:

GstCodecParsers.H265Profile

Returns a GstCodecParsers.H265Profile for the string.

New in version 1.18.

GstCodecParsers.h265_profile_to_string(profile)
Parameters:

profile (GstCodecParsers.H265Profile) – a GstCodecParsers.H265Profile

Returns:

the name for profile or None on error

Return type:

str or None

Returns the descriptive name for the GstCodecParsers.H265Profile.

New in version 1.18.

GstCodecParsers.h265_quant_matrix_4x4_get_raster_from_uprightdiagonal(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from uprightdiagonal scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_4x4_get_raster_from_zigzag(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from zigzag scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_4x4_get_uprightdiagonal_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to uprightdiagonal scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_4x4_get_zigzag_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to zigzag scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_8x8_get_raster_from_uprightdiagonal(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from uprightdiagonal scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_8x8_get_raster_from_zigzag(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from zigzag scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_8x8_get_uprightdiagonal_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to uprightdiagonal scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_quant_matrix_8x8_get_zigzag_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to zigzag scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.6.

GstCodecParsers.h265_sei_copy(dest_sei, src_sei)
Parameters:
Returns:

True if everything went fine, False otherwise

Return type:

bool

Copies src_sei into dst_sei

GstCodecParsers.h265_sei_free(sei)
Parameters:

sei (GstCodecParsers.H265SEIMessage) –

sei: The GstCodecParsers.H265SEIMessage to free Frees sei fields.

GstCodecParsers.h265_slice_type_to_string(slice_type)
Parameters:

slice_type (GstCodecParsers.H265SliceType) – a GstCodecParsers.H265SliceType

Returns:

the name for slice_type or None on error

Return type:

str or None

Returns the descriptive name for the GstCodecParsers.H265SliceType.

New in version 1.24.

GstCodecParsers.h266_parse_aps(parser, nalu, aps)
Parameters:
Returns:

a GstCodecParsers.H266ParserResult

Return type:

GstCodecParsers.H266ParserResult

Parses data, and fills the aps structure.

New in version 1.26.

GstCodecParsers.h266_parse_pps(parser, nalu, pps)
Parameters:
Returns:

a GstCodecParsers.H266ParserResult

Return type:

GstCodecParsers.H266ParserResult

Parses data, and fills the pps structure.

New in version 1.26.

GstCodecParsers.h266_parse_sps(parser, nalu, sps)
Parameters:
Returns:

a GstCodecParsers.H266ParserResult

Return type:

GstCodecParsers.H266ParserResult

Parses data, and fills the sps structure.

New in version 1.26.

GstCodecParsers.h266_parse_vps(nalu, vps)
Parameters:
Returns:

a GstCodecParsers.H266ParserResult

Return type:

GstCodecParsers.H266ParserResult

Parses data, and fills the vps structure.

New in version 1.26.

GstCodecParsers.h266_profile_from_string(string)
Parameters:

string (str) – the descriptive name for GstCodecParsers.H266Profile

Returns:

the GstCodecParsers.H266Profile of string or GstCodecParsers.H266Profile.INVALID on error

Return type:

GstCodecParsers.H266Profile

Returns a GstCodecParsers.H266Profile for the string.

New in version 1.26.

GstCodecParsers.h266_profile_to_string(profile)
Parameters:

profile (GstCodecParsers.H266Profile) – a GstCodecParsers.H266Profile

Returns:

the name for profile or None on error

Return type:

str or None

Returns the descriptive name for the GstCodecParsers.H266Profile.

New in version 1.26.

GstCodecParsers.jpeg2000_colorspace_from_string(colorspace_string)
Parameters:

colorspace_string (str) –

Return type:

GstCodecParsers.JPEG2000Colorspace

GstCodecParsers.jpeg2000_colorspace_to_string(colorspace)
Parameters:

colorspace (GstCodecParsers.JPEG2000Colorspace) –

Return type:

str

GstCodecParsers.jpeg2000_sampling_from_string(sampling_string)
Parameters:

sampling_string (str) –

Return type:

GstCodecParsers.JPEG2000Sampling

GstCodecParsers.jpeg2000_sampling_is_mono(sampling)
Parameters:

sampling (GstCodecParsers.JPEG2000Sampling) –

Return type:

bool

GstCodecParsers.jpeg2000_sampling_is_rgb(sampling)
Parameters:

sampling (GstCodecParsers.JPEG2000Sampling) –

Return type:

bool

GstCodecParsers.jpeg2000_sampling_is_yuv(sampling)
Parameters:

sampling (GstCodecParsers.JPEG2000Sampling) –

Return type:

bool

GstCodecParsers.jpeg2000_sampling_to_string(sampling)
Parameters:

sampling (GstCodecParsers.JPEG2000Sampling) –

Return type:

str

GstCodecParsers.jpeg_bit_writer_frame_header(frame_hdr, marker, size)
Parameters:
Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the bit stream generated by this frame header

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the according JPEG bit stream by providing the frame header.

New in version 1.26.

GstCodecParsers.jpeg_bit_writer_huffman_table(huff_tables, size)
Parameters:
Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the bit stream generated by the huffman tables

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the according JPEG bit stream by providing the huffman tables.

New in version 1.26.

GstCodecParsers.jpeg_bit_writer_quantization_table(quant_tables, size)
Parameters:
Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the bit stream generated by the quantization tables

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the according JPEG bit stream by providing the quantization tables.

New in version 1.26.

GstCodecParsers.jpeg_bit_writer_restart_interval(interval, size)
Parameters:
  • interval (int) – the interval value for restart

  • size (int) – the size in bytes of the input and output

Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the bit stream generated by the interval value

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the according JPEG bit stream by providing the interval value.

New in version 1.26.

GstCodecParsers.jpeg_bit_writer_scan_header(scan_hdr, size)
Parameters:
Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the bit stream generated by this scan header

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the according JPEG bit stream by providing the scan header.

New in version 1.26.

GstCodecParsers.jpeg_bit_writer_segment_with_data(marker, seg_data, seg_size, size)
Parameters:
Returns:

a GstCodecParsers.JpegBitWriterResult

data:

the generated bit stream of this segment

size:

the size in bytes of the input and output

Return type:

(GstCodecParsers.JpegBitWriterResult, data: int, size: int)

Generating the bit stream for a JPEG segment.

New in version 1.26.

GstCodecParsers.jpeg_get_default_huffman_tables()
Returns:

The default DC/AC Huffman tables to fill in

Return type:

huff_tables: GstCodecParsers.JpegHuffmanTables

Fills in huf_tables with the default AC/DC Huffman tables, as specified by the JPEG standard.

New in version 1.6.

GstCodecParsers.jpeg_get_default_quantization_tables(quant_tables)
Parameters:

quant_tables (GstCodecParsers.JpegQuantTables) –

GstCodecParsers.jpeg_parse(data, size, offset)
Parameters:
  • data (int) – The data to parse

  • size (int) – The size of data

  • offset (int) – The offset from which to start parsing

Returns:

True if a packet start code was found.

seg:

pointer to a GstCodecParsers.JpegSegment structure to fill in

Return type:

(bool, seg: GstCodecParsers.JpegSegment)

Parses the JPEG bitstream contained in data, and returns the detected segment as a GstCodecParsers.JpegSegment.

Note that a valid segment may be returned with a length that exceeds the available data. It is up to the caller to make sure there’s enough data available when parsing the segment.

New in version 1.6.

GstCodecParsers.lcevc_meta_api_get_type()
Returns:

the GObject.GType of the LCEVC meta API.

Return type:

GObject.GType

Gets the GObject.GType of the LCEVC meta API.

New in version 1.26.

GstCodecParsers.lcevc_meta_get_info()
Returns:

the GstCodecParsers.LcevcMeta of the LCEVC meta.

Return type:

Gst.MetaInfo

Gets the Gst.MetaInfo of the LCEVC meta.

New in version 1.26.

GstCodecParsers.mpeg4_parse(packet, skip_user_data, vop, data, offset, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data and fills packet with the information of the next packet found.

GstCodecParsers.mpeg4_parse_group_of_vop(gov, data, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data containing the group of video object plane packet, and fills the gov structure.

GstCodecParsers.mpeg4_parse_video_object_layer(vol, vo, data, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data containing the video object layer packet, and fills the vol structure.

GstCodecParsers.mpeg4_parse_video_object_plane(vop, sprite_trajectory, vol, data, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data containing the video object plane packet, and fills the vol structure.

GstCodecParsers.mpeg4_parse_video_packet_header(videopackethdr, vol, vop, sprite_trajectory, data, size)
Parameters:
Return type:

GstCodecParsers.Mpeg4ParseResult

Parsers data containing the video packet header and fills the videopackethdr structure

GstCodecParsers.mpeg4_parse_video_plane_short_header(shorthdr, data, size)
Parameters:
Return type:

GstCodecParsers.Mpeg4ParseResult

GstCodecParsers.mpeg4_parse_visual_object(vo, signal_type, data, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data containing the visual object packet, and fills the vo structure.

GstCodecParsers.mpeg4_parse_visual_object_sequence(vos, data, size)
Parameters:
Returns:

a GstCodecParsers.Mpeg4ParseResult

Return type:

GstCodecParsers.Mpeg4ParseResult

Parses data containing the visual object sequence packet, and fills the vos structure.

GstCodecParsers.mpeg_video_finalise_mpeg2_sequence_header(hdr, seqext, displayext)
Parameters:
Return type:

bool

GstCodecParsers.mpeg_video_meta_api_get_type()
Return type:

GObject.GType

GstCodecParsers.mpeg_video_meta_get_info()
Return type:

Gst.MetaInfo

GstCodecParsers.mpeg_video_parse(packet, data, size, offset)
Parameters:
Returns:

True if a packet start code was found, otherwise False.

Return type:

bool

Parses the MPEG 1/2 video bitstream contained in data, and returns the offset, and if known also the size, in packet. This function will scan the data to find the next packet if needed.

GstCodecParsers.mpeg_video_quant_matrix_get_raster_from_zigzag(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from zigzag scan order to raster scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.2.

GstCodecParsers.mpeg_video_quant_matrix_get_zigzag_from_raster(quant)
Parameters:

quant (int) – The source quantization matrix

Returns:

The resulting quantization matrix

Return type:

out_quant: int

Converts quantization matrix quant from raster scan order to zigzag scan order and store the resulting factors into out_quant.

Note: it is an error to pass the same table in both quant and out_quant arguments.

New in version 1.2.

GstCodecParsers.vc1_bitplanes_ensure_size(bitplanes, seqhdr)
Parameters:
Returns:

True if everything went fine, False otherwise

Return type:

bool

Fills the bitplanes structure from seqhdr, this function should be called after GstCodecParsers.vc1_parse_sequence_header if in simple or main mode, or after GstCodecParsers.vc1_parse_entry_point_header if in advanced mode.

GstCodecParsers.vc1_bitplanes_free(bitplanes)
Parameters:

bitplanes (GstCodecParsers.VC1BitPlanes) –

GstCodecParsers.vc1_bitplanes_free_1(bitplanes)
Parameters:

bitplanes (GstCodecParsers.VC1BitPlanes) –

GstCodecParsers.vc1_identify_next_bdu(data, size)
Parameters:
  • data (int) – The data to parse

  • size (int) – the size of data

Returns:

a GstCodecParsers.VC1ParserResult

bdu:

The GstCodecParsers.VC1BDU where to store parsed bdu headers

Return type:

(GstCodecParsers.VC1ParserResult, bdu: GstCodecParsers.VC1BDU)

Parses data and fills bdu fields

GstCodecParsers.vc1_parse_entry_point_header(data, size, seqhdr)
Parameters:
Returns:

a GstCodecParsers.VC1EntryPointHdr

entrypoint:

The GstCodecParsers.VC1EntryPointHdr to set.

Return type:

(GstCodecParsers.VC1ParserResult, entrypoint: GstCodecParsers.VC1EntryPointHdr)

Parses data, and sets entrypoint fields.

GstCodecParsers.vc1_parse_field_header(data, size, fieldhdr, seqhdr, bitplanes)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills fieldhdr fields.

GstCodecParsers.vc1_parse_frame_header(data, size, framehdr, seqhdr, bitplanes)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills entrypoint fields.

GstCodecParsers.vc1_parse_frame_layer(data, size, framelayer)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills framelayer fields.

GstCodecParsers.vc1_parse_sequence_header(data, size, seqhdr)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills seqhdr fields.

GstCodecParsers.vc1_parse_sequence_header_struct_a(data, size, structa)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills structa fields.

GstCodecParsers.vc1_parse_sequence_header_struct_b(data, size, structb)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills structb fields.

GstCodecParsers.vc1_parse_sequence_header_struct_c(data, size, structc)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills structc fields.

GstCodecParsers.vc1_parse_sequence_layer(data, size, seqlayer)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills seqlayer fields.

GstCodecParsers.vc1_parse_slice_header(data, size, slicehdr, seqhdr)
Parameters:
Returns:

a GstCodecParsers.VC1ParserResult

Return type:

GstCodecParsers.VC1ParserResult

Parses data, and fills slicehdr fields.

New in version 1.2.