Stream descriptors
Collection of classes to define the streams to process. It supports either audio and video stream (with FFmpeg filters that can be applied) or simple data streams.
- class mcai_worker_sdk.AudioStreamDescriptor(index, filters)
Class defining an audio stream descriptor.
- Parameters:
index (int) – Index of the stream.
filters (collections.abc.Sequence(
Filter)) – a list of FFmpeg filters to apply to the stream.
Examples
>>> audio_filter = mcai.Filter(name="aformat") >>> audio_filter.add_parameters(sample_rates=16000, channel_layouts="mono") >>> audio_stream = mcai.AudioStreamDescriptor(1, (audio_filter,))
- class mcai_worker_sdk.VideoStreamDescriptor(index, filters)
Class defining an video stream descriptor.
- Parameters:
index (int) – Index of the stream.
filters (collections.abc.Sequence(
Filter)) – a list of FFmpeg filters to apply to the stream.
Examples
>>> crop_filter = mcai.Filter(name="crop", label="crop_filter") >>> crop_filter.add_parameters(out_w=10, out_h=20) >>> video_stream = mcai.VideoStreamDescriptor(1, (crop_filter,))
- class mcai_worker_sdk.DataStreamDescriptor(index)
Class defining a data stream descriptor.
- Parameters:
index (int) – Index of the stream.
Examples
>>> data_stream = mcai.DataStreamDescriptor(1)
- class mcai_worker_sdk.StreamDescriptor
Class representing a stream.
Note
This class is provided for documentation purpose. It shouldn’t be used directly in the worker.
- avg_frame_rate
Average frame rate of the stream.
- channels
Channels of the stream.
- duration
Duration of the stream.
- height
Height of the stream.
- index
Index of the stream
- kind
Kind of the stream.
- nb_frames
Number of frames of the stream.
- r_frame_rate
Real base framerate of the stream.
- sample_rate
Sample rate of the stream.
- start_time
Start time of the stream.
- stream_metadata
Dictionnary containing the metadata of the stream.
- width
Width of the stream.