Python错误集锦:imageio从摄像头获取图像时提示:ImportError: To use the imageio ffmpeg plugin you need to ‘pip install imageio-ffmpeg’

原文链接:http://www.juzicode.com/python-error-importerror-to-use-the-imageio-ffmpeg-plugin

错误提示:

imageio从摄像头获取图像时提示:ImportError: To use the imageio ffmpeg plugin you need to ‘pip install imageio-ffmpeg’

#juzicode.com VX:桔子code #从相机获取
import imageio 
reader = imageio.get_reader('<video0>')
for im in reader:
    print(im.shape)
------运行结果:
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
d:\python\python38\lib\site-packages\imageio\plugins\ffmpeg.py in _get_ffmpeg_api()
     58         try:
---> 59             import imageio_ffmpeg
     60         except ImportError:

ModuleNotFoundError: No module named 'imageio_ffmpeg'

。。。。。。

d:\python\python38\lib\site-packages\imageio\plugins\ffmpeg.py in _get_ffmpeg_api()
     59             import imageio_ffmpeg
     60         except ImportError:
---> 61             raise ImportError(
     62                 "To use the imageio ffmpeg plugin you need to "
     63                 "'pip install imageio-ffmpeg'"

ImportError: To use the imageio ffmpeg plugin you need to 'pip install imageio-ffmpeg'

错误原因:

1、使用imageio模块读取视频或从摄像头获取画面,需要安装ffmpeg插件。

解决方法:

1、回到命令行窗口安装ffmpeg插件:

python -m pip install imageio-ffmpeg 


如果本文还没有完全解决你的疑惑,你也可以在微信公众号“桔子code”后台给我留言,欢迎一起探讨交流。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注