Revert "feat: replace Decord with video_reader-rs" (#8077)

This commit is contained in:
Mick
2025-07-16 11:04:56 +08:00
committed by GitHub
parent 69f453e5a4
commit 497efe747d
6 changed files with 21 additions and 16 deletions

View File

@@ -206,7 +206,7 @@ class BaseMultimodalProcessor(ABC):
estimate the total frame count from all visual input
"""
# Lazy import because decord is not available on some arm platforms.
from video_reader import PyVideoReader, cpu
from decord import VideoReader, cpu
# Before processing inputs
if not image_data or len(image_data) == 0:
@@ -216,7 +216,7 @@ class BaseMultimodalProcessor(ABC):
if isinstance(image, str) and image.startswith("video:"):
path = image[len("video:") :]
# Estimate frames for the video
vr = PyVideoReader(path, threads=0)
vr = VideoReader(path, ctx=cpu(0))
num_frames = len(vr)
else:
# For images, each contributes one frame