cutcutcodec.core.analysis.stream.shape

Smartly choose the shape of a video stream.

Functions

optimal_shape_video(stream[, t_min, t_max, ...])

Find the optimal frame shape for a given video stream.

Details

cutcutcodec.core.analysis.stream.shape.optimal_shape_video(stream: StreamVideo, t_min: Fraction | None = None, t_max: Fraction | float | None = None, choices: set[tuple[int, int]] | None = None) tuple[int, int] | None[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.

t_minfloat, optional

The lower bound of the time slice estimation.

t_maxfloat, optional

The higher bound of the time slice estimation.

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.