GstTranscoder.Transcoder¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether to re-encode portions of compatible video streams that lay on segment boundaries |
||
r/w/co |
Source URI |
||
r |
Duration |
||
r |
GStreamer pipeline that is used |
||
r |
Current Position |
||
r/w |
Interval in milliseconds between two position-updated signals.Pass 0 to stop updating the position. |
||
r/w/co |
The |
||
r/w/co |
Source URI |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GstTranscoder.Transcoder(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod is_transcoder_message(msg)¶
- Parameters:
msg (
Gst.Message
) – AGst.Message
- Returns:
A
bool
indicating whether the passes message represents aGstTranscoder.Transcoder
message or not.- Return type:
New in version 1.20.
- classmethod new(source_uri, dest_uri, encoding_profile)¶
- Parameters:
source_uri (
str
) – The URI of the media stream to transcodedest_uri (
str
) – The URI of the destination of the transcoded streamencoding_profile (
str
) – The serializedGstPbutils.EncodingProfile
defining the output format. Have a look at theGstPbutils.EncodingProfile
documentation to find more about the serialization format.
- Returns:
a new
GstTranscoder.Transcoder
instance- Return type:
- classmethod new_full(source_uri, dest_uri, profile)¶
- Parameters:
source_uri (
str
) – The URI of the media stream to transcodedest_uri (
str
) – The URI of the destination of the transcoded streamprofile (
GstPbutils.EncodingProfile
) – TheGstPbutils.EncodingProfile
defining the output format have a look at theGstPbutils.EncodingProfile
documentation to find more about the serialization format.
- Returns:
a new
GstTranscoder.Transcoder
instance- Return type:
- get_avoid_reencoding()¶
- get_dest_uri()¶
- Returns:
a string containing the URI of the destination of the transcoded stream.
GLib.free
() after usage.- Return type:
Gets the URI of the destination of the transcoded stream.
- get_duration()¶
- Returns:
the duration of the transcoding media stream, in nanoseconds.
- Return type:
Retrieves the duration of the media stream that self represents.
- get_message_bus()¶
- Returns:
The transcoder message bus instance
- Return type:
GstTranscoder.Transcoder
API exposes aGst.Bus
instance which purpose is to provide data structures representing transcoder-internal events in form ofGst.Message
-s of typeGst.MessageType.APPLICATION
.Each message carries a “transcoder-message” field of type
GstTranscoder.TranscoderMessage
. Further fields of the message data are specific to each possible value of that enumeration.Applications can consume the messages asynchronously within their own event-loop / UI-thread etc. Note that in case the application does not consume the messages, the bus will accumulate these internally and eventually fill memory. To avoid that, the bus has to be set “flushing”.
New in version 1.20.
- get_pipeline()¶
- Returns:
The internal uritranscodebin instance
- Return type:
- get_position()¶
- Returns:
the absolute position time, in nanoseconds, of the transcoding stream.
- Return type:
- get_position_update_interval()¶
- Returns:
current position update interval in milliseconds
- Return type:
- get_signal_adapter(context)¶
- Parameters:
context (
GLib.MainContext
orNone
) – AGLib.MainContext
on which the main-loop will process transcoder bus messages on. Can beNone
(thread-default context will be used then).- Returns:
The
GstTranscoder.TranscoderSignalAdapter
to connect signal handlers to.- Return type:
Gets the
GstTranscoder.TranscoderSignalAdapter
attached to self if it is attached to the rightGLib.MainContext
. If noGstTranscoder.TranscoderSignalAdapter
has been created yet, it will be created and returned, other calls will return that same adapter until it is destroyed, at which point, a new one can be attached the same way.New in version 1.20.
- get_source_uri()¶
- Returns:
a string containing the URI of the source stream.
GLib.free
() after usage.- Return type:
Gets the URI of the currently-transcoding stream.
- get_sync_signal_adapter()¶
- Returns:
The
GstTranscoder.TranscoderSignalAdapter
to connect signal handlers to.- Return type:
Gets the
GstTranscoder.TranscoderSignalAdapter
attached to self to emit signals from its thread of emission.New in version 1.20.
- run()¶
- Raises:
- Return type:
Run the transcoder task synchonously. You can connect to the ‘position’ signal to get information about the progress of the transcoding.
- run_async()¶
Run the transcoder task asynchronously. You should connect to the ‘done’ signal to be notified about when the transcoding is done, and to the ‘error’ signal to be notified about any error.
- set_avoid_reencoding(avoid_reencoding)¶
- set_cpu_usage(cpu_usage)¶
- Parameters:
cpu_usage (
int
) – The percentage of the CPU the process running the transcoder should try to use. It takes into account the number of cores available.
Sets cpu_usage as target percentage CPU usage of the process running the transcoding task. It will modulate the transcoding speed to reach that target usage.
Property Details¶
- GstTranscoder.Transcoder.props.avoid_reencoding¶
-
See #encodebin:avoid-reencoding
- GstTranscoder.Transcoder.props.dest_uri¶
- Name:
dest-uri
- Type:
- Default Value:
- Flags:
Source URI
- GstTranscoder.Transcoder.props.duration¶
-
Duration
- GstTranscoder.Transcoder.props.pipeline¶
- Name:
pipeline
- Type:
- Default Value:
- Flags:
GStreamer pipeline that is used
- GstTranscoder.Transcoder.props.position¶
-
Current Position
- GstTranscoder.Transcoder.props.position_update_interval¶
-
Interval in milliseconds between two position-updated signals.Pass 0 to stop updating the position.
- GstTranscoder.Transcoder.props.profile¶
- Name:
profile
- Type:
- Default Value:
- Flags:
The
GstPbutils.EncodingProfile
to use