0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

faster-whisperをインストールしたら、cv2.imshowがフリーズするようになった話

Last updated at Posted at 2023-03-28

環境

  • Ubuntu20.04.5LTS
  • Python 3.8.10
  • faster-whisper-0.2.0

状況

 faster-whisperをインストールして以降、ultralyticsやpretrainedmodelsなどをimportしたプログラムを実行した際にcv2.imshowの部分でフリーズする。

原因

 faster-whisperの依存関係にあるPyAVが悪さをしていた。調べてみると、以下の記載を見つけた。

OpenCV uses FFmpeg as back-end for video decoding and encoding. OpenCV distributes own instance of FFmpeg to have it functional on all platforms independently from user setup. It looks like our instance of FFmpeg and AV provided FFmpeg are not compatible (different size of objects, different set of function parameters, etc) and it cases the issue.
https://github.com/opencv/opencv/issues/21952#issuecomment-1123464048

解決策

以下を実行しPyAVを一度アンインストールしてから、FFmpegなしのPyAVをインストールする。
これによって、システムにあるすでに利用可能なFFmpegが使用されるようになった。

$ pip uninstall av
$ pip install av --no-binary av

参考記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?