spdl.io.decode_packets¶
- decode_packets(packets: AudioPackets, filter_desc: str | None = _FILTER_DESC_DEFAULT, **kwargs) AudioFrames[source]¶
- decode_packets(packets: VideoPackets, filter_desc: str | None = _FILTER_DESC_DEFAULT, **kwargs) VideoFrames
- decode_packets(packets: ImagePackets, filter_desc: str | None = _FILTER_DESC_DEFAULT, **kwargs) ImageFrames
Decode packets.
- Parameters:
packets (AudioPackets, VideoPackets or ImagePackets) – Packets object.
filter_desc –
Optional: Custom filter applied after decoding. To generate a description for common media processing operations, use
get_filter_desc()(if you have a packets object that has the timestamp set),get_audio_filter_desc(), orget_video_filter_desc(). IfNoneis provided, then filtering is disabled.Note
When decoding image/video packets, by default color space conversion is applied so that the output pixel format is rgb24. If you want to obtain frames without color conversion, disable filter by providing
filter_desc=None, or specifypix_fmt=Nonein the filter desc factory function.decode_config (DecodeConfig) – Optional: Custom decode config. See
decode_config(),
- Returns:
Frames object.