IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python function

validate_video

validate_video()​

max.pipelines.context.validate_video(source, max_decoded_bytes=None)

source

Checks a video’s header, decoding no frame.

Intended for trust boundaries (the serving layer) that want an unreadable or oversized video rejected as a client error before it reaches a model worker. The video is decoded exactly once, by whoever consumes it, so damage inside the stream surfaces there rather than here.

Parameters:

  • source (str | bytes) – The video to validate.
  • max_decoded_bytes (int | None) – Decoded-byte budget available to the video. A frame is allocated at full size before any check can run on it, so the header dimensions are checked against this before decoding.

Raises:

Return type:

None