From 4c91a28e301dc55a8dccd683e203ca69f1d09939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=87=83?= Date: Sat, 18 Oct 2025 00:26:33 +0800 Subject: [PATCH] [bugfix] Qwen3-VL fix video incorrect timestamp calculations while do_sample_frames=True (#27104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 松灵 --- vllm/model_executor/models/qwen3_vl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/model_executor/models/qwen3_vl.py b/vllm/model_executor/models/qwen3_vl.py index 794646d05..1718cb260 100644 --- a/vllm/model_executor/models/qwen3_vl.py +++ b/vllm/model_executor/models/qwen3_vl.py @@ -735,9 +735,9 @@ class Qwen3VLProcessingInfo(Qwen2VLProcessingInfo): if do_sample_frames: # here video_fps is the fps of the sampled video, and # metadata["fps"] refers to the fps of the original video. - video_fps = sampled_fps if sampled_fps else video_processor.fps + sampled_fps = sampled_fps if sampled_fps else video_processor.fps total_num_frames = metadata["total_num_frames"] - num_frames = int(total_num_frames / metadata["fps"] * video_fps) + num_frames = int(total_num_frames / metadata["fps"] * sampled_fps) num_frames = min( min( max(num_frames, video_processor.min_frames),