简体   繁体   English

无法打开编解码器“ libopenh264”:未指定的错误

[英]Could not open codec 'libopenh264': Unspecified error

I am using OpenCV to process videos for my research. 我正在使用OpenCV处理用于研究的视频。 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. 我在Windows 10上安装了Python 2.7和OpenCV 3.2版本。当我使用OpenCV在Python视频中进行背景减法时,它可以正常工作并产生输出。 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

I am processing MP4 videos. 我正在处理MP4视频。 And I followed the instructions carefully while installing ffmpeg, like adding the bin's path to environment variables. 而且我在安装ffmpeg时仔细地遵循了说明,例如将bin的路径添加到环境变量中。 I don't know what else to do. 我不知道该怎么办 Stuck on this for three days now. 坚持了三天了。

Any help would be much appreciated! 任何帮助将非常感激! Thanks in advance!! 提前致谢!!

The error message you are getting says that openCV can't load the H264 codec. 您收到的错误消息称openCV无法加载H264编解码器。 H264 doesn't come by default with the default installation of openCV. 默认安装的openCV没有默认提供H264。

To add the H264 codec download 'openh264-1.6.0-win64msvc.dll.bz2' from https://github.com/cisco/openh264/releases/tag/v1.6.0 . 要添加H264编解码器, https://github.com/cisco/openh264/releases/tag/v1.6.0下载'openh264-1.6.0-win64msvc.dll.bz2'。

Extract the file and move the extracted DLL to the same directory as your python file. 解压缩文件并将解压缩的DLL移至与python文件相同的目录。 OpenCV should now be able to find the DLL and load the H264 codec. OpenCV现在应该能够找到DLL并加载H264编解码器。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM