Skip to content

vllm.multimodal.video_decoders.base

Classes:

Functions:

VideoSourceMetadata

Bases: NamedTuple

Metadata describing the encoded video source.

Source code in vllm/multimodal/video_decoders/base.py
class VideoSourceMetadata(NamedTuple):
    """Metadata describing the encoded video source."""

    total_frames_num: int
    original_fps: float
    duration: float

VideoTargetMetadata

Bases: NamedTuple

Metadata describing the requested video sample.

Source code in vllm/multimodal/video_decoders/base.py
class VideoTargetMetadata(NamedTuple):
    """Metadata describing the requested video sample."""

    num_frames: int
    fps: float
    max_duration: float

check_frame_pixel_limit(width, height)

Reject video frames exceeding VLLM_MAX_IMAGE_PIXELS.

Source code in vllm/multimodal/video_decoders/base.py
def check_frame_pixel_limit(width: int, height: int) -> None:
    """Reject video frames exceeding ``VLLM_MAX_IMAGE_PIXELS``."""
    max_pixels = envs.VLLM_MAX_IMAGE_PIXELS
    if max_pixels > 0 and width * height > max_pixels:
        raise ValueError(
            f"Video frame dimensions {width}x{height} "
            f"({width * height} pixels) exceed the maximum of "
            f"{max_pixels} pixels. Set VLLM_MAX_IMAGE_PIXELS to "
            f"increase this limit."
        )