DecodedFrame

Represents a single decoded video frame, including metadata and raw pixel data.

Attributes:
  • camera (Camera) –

    Metadata about the camera that produced the frame.

  • timestamp (float) –

    Presentation timestamp (PTS) of the frame in seconds.

  • frame_caps (Caps) –

    GStreamer capabilities associated with the frame (e.g. resolution, format).

  • frame_number (int) –

    Sequential number of the frame in the stream.

  • np_frame (ndarray) –

    The actual decoded frame data as a NumPy array as RGB.

age(reference=None)

Calculates the age of the frame in seconds.

Parameters:
  • reference (Optional(float, default: None ) –

    Reference time in seconds, if not given

Returns:
  • float( float ) –

    The age of the frame in seconds.

shape()

Returns the shape of the frame as a tuple (height, width, channels).

to_bgr()

Converts the RGB frame to BGR format.

Returns:
  • Optional[ndarray]

    Optional[np.ndarray]: The frame data in BGR format, or None if no frame is available.