cutcutcodec.core.analysis.stream.shape

Smartly choose the shape of a video stream.

Functions

optimal_shape_video(stream[, choices])

Find the optimal frame shape for a given video stream.

Details

cutcutcodec.core.analysis.stream.shape.optimal_shape_video(stream: StreamVideo, choices: set[tuple[int, int]] | None = None) None | tuple[int, int][source]

Find the optimal frame shape for a given video stream.

Parameters

streamcutcutcodec.core.classes.stream_video.StreamVideo

The video stream that we want to find the optimal fps.

choicesset[tuple[int, int]], optional

The possible shape. If provide, returns the most appropriate shape of this set. The convention adopted is the numpy convention (height, width) in pixels.

Returns

shapetuple[int, int]

The shape that limit the reshape informations and the information loss.