Skip to content

Fix video reading hang issue with Decord in qwen-vl-utils - #1078

Open
nku-zhichengzhang wants to merge 1 commit into
QwenLM:mainfrom
nku-zhichengzhang:main
Open

Fix video reading hang issue with Decord in qwen-vl-utils#1078
nku-zhichengzhang wants to merge 1 commit into
QwenLM:mainfrom
nku-zhichengzhang:main

Conversation

@nku-zhichengzhang

@nku-zhichengzhang nku-zhichengzhang commented Apr 9, 2025

Copy link
Copy Markdown

Overview

  • This PR adds the ability to read videos in Qwen2.5-VL through OpenCV and adds a timeout mechanism to prevent being stuck. This enhancement prevents the stuck case of reading custom or specific videos.
  • 为了防止用decord读取某些视频时卡顿阻塞队列,增加了截断机制以及切换至兼容性更好的opencv。

Changes

  • Added an alternative support for video reading method (opencv)
  • 增加了对OpenCV视频读取的支持
  • Added a timeout mechanism for reading videos by decord
  • 增加了截断机制

Background & Motivation

  • qwen-vl-utils relies on decord and faces being stuck when reading videos, impacting the users who use downstream frameworks, including vllm and ms-swift. The core reason behind this is the C package conflict, which is hard to solve. This PR makes a simple fix by shutting down the long-time stuck subprocess and using more compatible OpenCV as an alternative.
  • qwen-vl-utils 依赖于 decord,在读取视频时会出现卡住的情况,这影响了使用下游框架(包括 vllm 和 ms-swift)的用户。其核心原因是 C 包冲突问题,这很难解决 get_batch hang in some condition. I can provide the reproduce repo. dmlc/decord#269 。此 PR 通过关闭长时间卡住的子进程,并使用兼容性更好的 OpenCV 作为替代方案,进行了一项简单的修复。

Related Issues

Stuck when reading some videos: #736

@nku-zhichengzhang nku-zhichengzhang changed the title Fix the bug of stuck when reading video Apr 9, 2025
@nku-zhichengzhang nku-zhichengzhang changed the title Fix the bug of stuck when reading video using decord in qwen-vl-utils Apr 9, 2025
@ohmyitscasper

Copy link
Copy Markdown

One thing to note here - after the executor times out with except concurrent.futures.TimeoutError: that thread isn't actually killed, and will continue to hang around as a zombie thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants