Video processing#

Inspect video files and normalize their encoding and resolution before uploading them.

API Reference#

Module: nominal.experimental.video_processing.

Classes

VideoResolution

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

Functions

frame_count

Given a path to a video file, return the number of frames present in the video.

has_audio_track

Given a path to a video file, return whether or not there is an audio track present.

normalize_video

Convert video file to an h264 encoded video file using ffmpeg.

scale_factor_from_resolution

Build a video filter that scales the video using ffmpeg.

Constants

FULL_HD

VideoResolution(resolution_width=1920, resolution_height=1080, allow_upscaling=False)

HIGH_DEFINITION

VideoResolution(resolution_width=1280, resolution_height=720, allow_upscaling=False)

QUAD_HD

VideoResolution(resolution_width=2560, resolution_height=1440, allow_upscaling=False)

STANDARD_DEFINITION

VideoResolution(resolution_width=640, resolution_height=480, allow_upscaling=False)

ULTRA_HD

VideoResolution(resolution_width=3840, resolution_height=2160, allow_upscaling=False)

Type aliases

AnyResolutionType

Literal['480p', '720p', '1080p', '1440p', '2160p'] | VideoResolution

ResolutionSpecifier

Literal['480p', '720p', '1080p', '1440p', '2160p']