GstPbutils.EncodingProfile

g GObject.Object GObject.Object GstPbutils.EncodingProfile GstPbutils.EncodingProfile GObject.Object->GstPbutils.EncodingProfile

Subclasses:

GstPbutils.EncodingAudioProfile, GstPbutils.EncodingContainerProfile, GstPbutils.EncodingVideoProfile

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

find (targetname, profilename, category)

class

from_discoverer (info)

copy ()

get_allow_dynamic_output ()

get_description ()

get_element_properties ()

get_file_extension ()

get_format ()

get_input_caps ()

get_name ()

get_presence ()

get_preset ()

get_preset_name ()

get_restriction ()

get_single_segment ()

get_type_nick ()

is_enabled ()

is_equal (b)

set_allow_dynamic_output (allow_dynamic_output)

set_description (description)

set_element_properties (element_properties)

set_enabled (enabled)

set_format (format)

set_name (name)

set_presence (presence)

set_preset (preset)

set_preset_name (preset_name)

set_restriction (restriction)

set_single_segment (single_segment)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

element-properties

Gst.Structure

r/w/en

The element properties to use. Example: {properties,boolean-prop=true,string-prop=”hi”}.

restriction-caps

Gst.Caps

r/w/en

The restriction caps to use

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GstPbutils.EncodingProfile(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GstPbutils.EncodingProfileClass

The opaque base class object for all encoding profiles. This contains generic information like name, description, format and preset.

classmethod find(targetname, profilename, category)[source]
Parameters:
  • targetname (str) – The name of the target

  • profilename (str or None) – The name of the profile, if None provided, it will default to the encoding profile called default.

  • category (str or None) – The target category. Can be None

Returns:

The matching GstPbutils.EncodingProfile or None.

Return type:

GstPbutils.EncodingProfile or None

Find the GstPbutils.EncodingProfile with the specified name and category.

classmethod from_discoverer(info)[source]
Parameters:

info (GstPbutils.DiscovererInfo) – The GstPbutils.DiscovererInfo to read from

Returns:

The new GstPbutils.EncodingProfile or None.

Return type:

GstPbutils.EncodingProfile or None

Creates a GstPbutils.EncodingProfile matching the formats from the given GstPbutils.DiscovererInfo. Streams other than audio or video (eg, subtitles), are currently ignored.

copy()[source]
Returns:

The copy of self

Return type:

GstPbutils.EncodingProfile

Makes a deep copy of self

New in version 1.12.

get_allow_dynamic_output()[source]
Return type:

bool

Get whether the format that has been negotiated in at some point can be renegotiated later during the encoding.

get_description()[source]
Returns:

the description of the profile, can be None.

Return type:

str or None

get_element_properties()[source]
Returns:

The properties that are going to be set on the underlying element

Return type:

Gst.Structure or None

New in version 1.20.

get_file_extension()[source]
Returns:

a suitable file extension for self, or None.

Return type:

str or None

get_format()[source]
Returns:

(nullable): the Gst.Caps corresponding to the media format used in the profile. Unref after usage.

Return type:

Gst.Caps

get_input_caps()[source]
Returns:

The full caps the given self can consume. Call gst_caps_unref() when you are done with the caps.

Return type:

Gst.Caps

Computes the full output caps that this self will be able to consume.

get_name()[source]
Returns:

the name of the profile, can be None.

Return type:

str or None

get_presence()[source]
Returns:

The number of times the profile is used in its parent container profile. If 0, it is not a mandatory stream.

Return type:

int

get_preset()[source]
Returns:

the name of the Gst.Preset to be used in the profile. This is the name that has been set when saving the preset.

Return type:

str or None

get_preset_name()[source]
Returns:

the name of the Gst.Preset factory to be used in the profile.

Return type:

str or None

get_restriction()[source]
Returns:

The restriction Gst.Caps to apply before the encoder that will be used in the profile. The fields present in restriction caps are properties of the raw stream (that is before encoding), such as height and width for video and depth and sampling rate for audio. Does not apply to GstPbutils.EncodingContainerProfile (since there is no corresponding raw stream). Can be None. Unref after usage.

Return type:

Gst.Caps or None

get_single_segment()[source]
Returns:

True if the stream represented by self should use a single segment before the encoder, False otherwise. This means that buffers will be retimestamped and segments will be eat so as to appear as one segment.

Return type:

bool

New in version 1.18.

get_type_nick()[source]
Returns:

the human-readable name of the type of self.

Return type:

str

is_enabled()[source]
Return type:

bool

is_equal(b)[source]
Parameters:

b (GstPbutils.EncodingProfile) – a GstPbutils.EncodingProfile

Returns:

True if self and b are equal, else False.

Return type:

bool

Checks whether the two GstPbutils.EncodingProfile are equal

set_allow_dynamic_output(allow_dynamic_output)[source]
Parameters:

allow_dynamic_output (bool) – Whether the format that has been negotiated first can be renegotiated during the encoding

Sets whether the format that has been negotiated in at some point can be renegotiated later during the encoding.

set_description(description)[source]
Parameters:

description (str or None) – the description to set on the profile

Set description as the given description for the self. A copy of description will be made internally.

set_element_properties(element_properties)[source]
Parameters:

element_properties (Gst.Structure) – A Gst.Structure defining the properties to be set to the element the profile represents.

This allows setting the muxing/encoding element properties.

**Set properties generically**

`` properties

[element-properties, boolean-prop=true, string-prop=”hi”]

``

**Mapping properties with well known element factories**

`` properties element-properties-map, map = {

[openh264enc, gop-size=32, ], [x264enc, key-int-max=32, tune=zerolatency],

}

``

New in version 1.20.

set_enabled(enabled)[source]
Parameters:

enabled (bool) – False to disable self, True to enable it

Set whether the profile should be used or not.

New in version 1.6.

set_format(format)[source]
Parameters:

format (Gst.Caps) – the media format to use in the profile.

Sets the media format used in the profile.

set_name(name)[source]
Parameters:

name (str or None) – the name to set on the profile

Set name as the given name for the self. A copy of name will be made internally.

set_presence(presence)[source]
Parameters:

presence (int) – the number of time the profile can be used

Set the number of time the profile is used in its parent container profile. If 0, it is not a mandatory stream

set_preset(preset)[source]
Parameters:

preset (str or None) – the element preset to use

Sets the name of the Gst.Element that implements the Gst.Preset interface to use for the profile. This is the name that has been set when saving the preset.

set_preset_name(preset_name)[source]
Parameters:

preset_name (str or None) – The name of the preset to use in this self.

Sets the name of the Gst.Preset's factory to be used in the profile.

set_restriction(restriction)[source]
Parameters:

restriction (Gst.Caps or None) – the restriction to apply

Set the restriction Gst.Caps to apply before the encoder that will be used in the profile. See GstPbutils.EncodingProfile.get_restriction() for more about restrictions. Does not apply to GstPbutils.EncodingContainerProfile.

set_single_segment(single_segment)[source]
Parameters:

single_segment (bool) – True if the stream represented by self should use a single segment before the encoder, False otherwise.

If using a single segment, buffers will be retimestamped and segments will be eat so as to appear as one segment.

*NOTE*: Single segment is not property supported when using #encodebin:avoid-reencoding

New in version 1.18.

Property Details

GstPbutils.EncodingProfile.props.element_properties
Name:

element-properties

Type:

Gst.Structure

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A Gst.Structure defining the properties to be set to the element the profile represents.

For example for av1enc :

`` element-properties,row-mt=true, end-usage=vbr ``

New in version 1.20.

GstPbutils.EncodingProfile.props.restriction_caps
Name:

restriction-caps

Type:

Gst.Caps

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The restriction caps to use