cutcutcodec.core.classes.frame_video

Defines the structure a video frame.

Classes

FrameVideo(time, data, **kwargs)

An image with time information for video context.

Details

class cutcutcodec.core.classes.frame_video.FrameVideo(time: Fraction | Real | str, data: Tensor | ndarray | Container, **kwargs)[source]

An image with time information for video context.

Behaves like a torch tensor of shape (height, width, channels). The shape is consistent with pyav and cv2. The dtype is always float32.

Attributes

channelsint

The numbers of layers (readonly):

  • 1 -> grayscale

  • 2 -> grayscale, alpha

  • 3 -> red, green, blue

  • 4 -> red, green, blue, alpha

heightint

The dimension i (vertical) of the image in pxl (readonly).

timeFraction

The time of the frame inside the video stream in second (readonly).

widthint

The dimension j (horizontal) of the image in pxl (readonly).

Construct a video frame and normalize the type.

Parameters

timeFraction

The time of the frame inside the video stream in second

dataarraylike

Transmitted to cutcutcodec.core.classes.frame.Frame initialisator.

**kwargsdict

Transmitted to cutcutcodec.core.classes.frame.Frame initialisator.