spdl.io.VideoPackets¶
- class VideoPackets¶
Packets object containing video frames.
See Packets and Frames for information about the Packets base concept.
Attributes
Clone the packets, so that data can be decoded multiple times.
The codec.
The frame rate of the video in the form of
(numerator, denominator).Get the timestamp of packets.
The height of video.
The name of the pixel format, such as
"yuv420p".The window this packets covers, denoted by start and end time in second.
The width of video.
- __len__¶
Returns the number of packets.
Note
Each packet typically contains one compressed frame, but it is not guaranteed.
- clone¶
Clone the packets, so that data can be decoded multiple times.
- Returns:
A clone of the packets.
- property codec¶
The codec.
- property frame_rate¶
The frame rate of the video in the form of
(numerator, denominator).
- get_timestamps¶
Get the timestamp of packets.
By default, the returned timestamps are sorted by display time, and if user specified a time window when demuxing, the timestamps outside of the window is discatded.
- Parameters:
raw –
If
True, the order of timestamps correspond to the order of packets, which is not necessarily ordered by display time. Also the user-specified window is not applied, so timestamps for all the packets are returned.This option is mainly for debugging.
- property height¶
The height of video.
- property pix_fmt¶
The name of the pixel format, such as
"yuv420p".
- property timestamp¶
The window this packets covers, denoted by start and end time in second.
This is the value specified by user when demuxing the stream.
- property width¶
The width of video.