Quantcast
Channel: 浏忙大爆炸
Viewing all articles
Browse latest Browse all 107

Failed to load OpenH264 library: openh264-1.6.0-win64msvc.dll

$
0
0

Windows 下用 Python3 和 OpenCV3.3.1 来写算法,在生成 H.264 的视频的时候,碰到提示这样一个错误:

Failed to load OpenH264 library: openh264-1.6.0-win64msvc.dll
Please check environment and/or download library: https://github.com/cis
co/openh264/releases
[libopenh264 @ 000000000038dfe0] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error
Ran out of input
2017-12-09 12:41:12,497 - INFO - Total cost 2165.5198607444763 seconds

两个解决办法:

1. 修改生成视频的编码器类型,不要用 acv1 编码器,比如说可以试试 XVID 编码器。

#cv2.VideoWriter_fourcc(*'avc1')
cv2.VideoWriter_fourcc(*'XVID')

2. 去 openh264 下载对应的版本,放到 PATH 目录里,这样让 python 能够正常加载这个动态库。

比如在我这里,就去下载 openh264-1.6.0-win64msvc.dll.bz2 这个版本,然后放到一个 PATH 包含的目录里,让这个库能正常加载。

如果你成功加载了这个 openh264 库后,即可在终端输出里看到这样的一句话:

OpenH264 Video Codec provided by Cisco Systems, Inc.

这样就能在 Windows 下用 Python3 + OpenCV3.3.1 来生成视频了。

© 2017, 浏忙大爆炸. All rights reserved.
除非注明,浏忙大爆炸文章均为原创,转载请以链接形式标明本文地址。


Viewing all articles
Browse latest Browse all 107

Trending Articles