无法打开编解码器"libopenh264":未指定的错误 [英] Could not open codec 'libopenh264': Unspecified error

查看:974
本文介绍了无法打开编解码器"libopenh264":未指定的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenCV处理用于研究的视频.我在Windows 10上安装了Python 2.7和OpenCV 3.2版本.当我使用OpenCV在Python视频中进行背景减法时,它可以正常工作并产生输出.但是,当我尝试保存减去背景的视频时,会引发以下错误:

I am using OpenCV to process videos for my research. I have Python 2.7 and OpenCV 3.2 versions installed on Windows 10. When I do background subtraction on a video in Python using OpenCV, it works fine and produces the output. However, when I try to save the background subtracted video, it throws this error:

warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:779)
warning: MAH00119.avi (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:780)
OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and format 'h264 / raw H.264 video'

Failed to load OpenH264 library: openh264-1.6.0-win64msvc.dll
    Please check environment and/or download library: https://github.com/cisco/openh264/releases

[libopenh264 @ 0000000001f5bf60] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error

我正在处理MP4视频.而且我在安装ffmpeg时仔细地遵循了说明,例如将bin的路径添加到环境变量中.我不知道该怎么办坚持了三天了.

I am processing MP4 videos. And I followed the instructions carefully while installing ffmpeg, like adding the bin's path to environment variables. I don't know what else to do. Stuck on this for three days now.

任何帮助将不胜感激! 在此先感谢!

Any help would be much appreciated! Thanks in advance!!

推荐答案

您收到的错误消息称openCV无法加载H264编解码器.默认安装的openCV没有默认提供H264.

The error message you are getting says that openCV can't load the H264 codec. H264 doesn't come by default with the default installation of openCV.

要添加H264编解码器,请从 https://github.com/cisco/openh264/releases/tag/v1.6.0 .

To add the H264 codec download 'openh264-1.6.0-win64msvc.dll.bz2' from https://github.com/cisco/openh264/releases/tag/v1.6.0.

解压缩文件,并将提取的DLL移至与python文件相同的目录.现在,OpenCV应该能够找到DLL并加载H264编解码器.

Extract the file and move the extracted DLL to the same directory as your python file. OpenCV should now be able to find the DLL and load the H264 codec.

请注意,在您的错误消息中,openCV正在寻找我们现在提供的openh264-1.6.0-win64msvc.dll(无法加载:openh264-1.6.0-win64msvc.dll.bz2).

Note that in your error message, openCV is looking for the openh264-1.6.0-win64msvc.dll (failed to load: openh264-1.6.0-win64msvc.dll.bz2) which is what we have now provided.

这篇关于无法打开编解码器"libopenh264":未指定的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆