VideoResolution#

class nominal.experimental.video_processing.VideoResolution(resolution_width: int | None = None, resolution_height: int | None = None, allow_upscaling: bool = False)#

Bases: object

Width and height limits for video scaling, with optional upscaling.

resolution_width: int | None = None#

Maximum width of the video, in pixels. Unbounded if None. NOTE: MUST be divisible by 2.

resolution_height: int | None = None#

Maximum height of the video, in pixels. Unbounded if None. NOTE: MUST be divisible by 2.

allow_upscaling: bool = False#

If true, allow upscaling beyond original resolution (e.g. 1080p -> 4k)

scale_factor() → str#

Output a video filter flag usable with Ffmpeg to rescale a video to fit within this resolution.