vllm.multimodal.video_decoders.base
¶
Classes:
-
SampledFramesCharge–Charges the decoded size of sampled video frames to a request budget.
-
VideoSourceMetadata–Metadata describing the encoded video source.
-
VideoTargetMetadata–Metadata describing the requested video sample.
Functions:
-
charge_frame_copies–Charge
num_copiescopies of a decoded frame offrame_bytesbytes. -
charge_sampled_frames–Charge
num_framesRGB frames ofwidthxheightbefore decoding. -
charging_sampled_frames–Route
charge_sampled_framescalls made in this context tocharge. -
check_frame_pixel_limit–Reject video frames exceeding
VLLM_MAX_IMAGE_PIXELS.
SampledFramesCharge
¶
Charges the decoded size of sampled video frames to a request budget.
VideoMediaIO installs one with charging_sampled_frames while a loader
runs. Decoders call charge_sampled_frames once they know the frame
size and the sampled indices, so an oversized sample is rejected before
any frame is decoded.
Source code in vllm/multimodal/video_decoders/base.py
VideoSourceMetadata
¶
VideoTargetMetadata
¶
charge_frame_copies(num_copies, frame_bytes)
¶
Charge num_copies copies of a decoded frame of frame_bytes bytes.
Loaders that repeat decoded frames call this before allocating the copies, so the copies count toward the per-request decoded-media budget before they exist.
Source code in vllm/multimodal/video_decoders/base.py
charge_sampled_frames(num_frames, width, height)
¶
Charge num_frames RGB frames of width x height before decoding.
Raises ValueError when the frames would exceed the per-request
decoded-media budget (VLLM_MAX_MEDIA_REQUEST_DECODE_BYTES).
Source code in vllm/multimodal/video_decoders/base.py
charging_sampled_frames(charge)
¶
Route charge_sampled_frames calls made in this context to charge.
Source code in vllm/multimodal/video_decoders/base.py
check_frame_pixel_limit(width, height)
¶
Reject video frames exceeding VLLM_MAX_IMAGE_PIXELS.