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 class

OutputVideoContent

OutputVideoContent

class max.pipelines.request.OutputVideoContent(*, type='output_video', video_url=None, video_data=None, format=None, frames_per_second=None, num_frames=None, frames=None)

source

Bases: BaseModel

Video content generated by the model in output messages.

Parameters:

format

format: str | None

source

frames

frames: SkipJsonSchema[npt.NDArray[np.uint8] | None]

source

frames_per_second

frames_per_second: int | None

source

from_numpy_frames()

classmethod from_numpy_frames(frames, *, frames_per_second=None, format=None)

source

Create internal video content from raw frame data.

Parameters:

  • frames (ndarray[tuple[Any, ...], dtype[uint8]]) – A uint8 array with shape [T, H, W, C] containing raw video frames.
  • frames_per_second (int | None) – Optional frame rate metadata to attach.
  • format (str | None) – Optional output format metadata, typically "mp4".

Returns:

An OutputVideoContent instance carrying raw frames for later route-level encoding.

Return type:

OutputVideoContent

model_config

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'frozen': True}

source

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

num_frames

num_frames: int | None

source

type

type: Literal['output_video']

source

video_data

video_data: str | None

source

video_url

video_url: str | None

source