vllm.multimodal.video_decoders
¶
Modules:
-
base– -
deepstream– -
opencv– -
pynvvideocodec– -
torchcodec–
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. -
decode_video–Decode a sampled video, importing only the selected backend.
-
incompatible_backend_options–Option names accepted by
old_backendbut not bynew_backend. -
resolve_video_backend_kwargs–Split frame-sampling kwargs from options owned by a decoder backend.
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.
Source code in vllm/multimodal/video_decoders/base.py
decode_video(backend, loader_cls, data, target, sampling_kwargs, backend_kwargs, *, frame_recovery)
¶
Decode a sampled video, importing only the selected backend.
Source code in vllm/multimodal/video_decoders/__init__.py
incompatible_backend_options(old_backend, new_backend)
¶
Option names accepted by old_backend but not by new_backend.
Source code in vllm/multimodal/video_decoders/__init__.py
resolve_video_backend_kwargs(backend, kwargs)
¶
Split frame-sampling kwargs from options owned by a decoder backend.