spdl.io.VideoPackets

class VideoPackets[source]

Packets object containing video frames.

Methods

clone()

Clone the packets, so that data can be decoded multiple times.

Attributes

frame_rate

The frame rate of the video in the form of (numerator, denominator).

height

The height of video.

pix_fmt

The name of the pixel format, such as "yuv420p".

timestamp

The window this packets covers, denoted by start and end time in second.

width

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 frame_rate: tuple[int, int][source]

The frame rate of the video in the form of (numerator, denominator).

property height: int[source]

The height of video.

property pix_fmt: str[source]

The name of the pixel format, such as "yuv420p".

property timestamp: tuple[float, float] | None[source]

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: int[source]

The width of video.