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

open_video_container

open_video_container()โ€‹

max.pipelines.context.open_video_container(source)

source

Opens a video container for reading via PyAV, rejecting known-vulnerable codecs.

Video-decoding pipelines should open containers through this function rather than calling av.open directly, so the codec blocklist applies uniformly everywhere PyAV decodes untrusted video input.

Parameters:

source (str | IO[bytes]) โ€“ A file path or file-like object containing the encoded video.

Returns:

The opened input container.

Raises:

MediaDecodeError โ€“ If any video stream uses a blocked codec.

Return type:

InputContainer