spdl.io.VideoPackets¶
- class VideoPackets[source]¶
Packets object containing video frames.
Methods
clone
()Clone the packets, so that data can be decoded multiple times.
get_timestamps
(*[, raw])Get the timestamp of packets.
Attributes
The codec.
The frame rate of the video in the form of
(numerator, denominator)
.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__() int [source]¶
Returns the number of packets.
Note
Each packet typically contains one compressed frame, but it is not guaranteed.
- clone() VideoPackets [source]¶
Clone the packets, so that data can be decoded multiple times.
- Returns:
A clone of the packets.
- property codec: VideoCodec[source]¶
The codec.
- property frame_rate: tuple[int, int][source]¶
The frame rate of the video in the form of
(numerator, denominator)
.
- get_timestamps(*, raw: bool = False) list[float] [source]¶
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.