Anaconda 找不到 openh264 库

Anaconda cannot find openh264 library

我正在尝试安装 openh264 以在 jupyter 笔记本上与 opencv 一起使用。我在 Windows 10 Pro 环境中的 anaconda 提示符下工作。我正在使用找到的推荐频道 on the Anaconda website

对于他们中的每一个,它 returns

Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:
- openh264

Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

我还尝试将一个频道 conda-forge 添加到默认频道列表中:

conda config --append channels conda-forge 

然后尝试使用

安装
conda install openh264  

但我得到了相同的结果。

pip 安装

pip install openh264    

returns

Collecting openh264 ERROR: Could not find a version that satisfies the requirement openh264 (from versions: none) ERROR: No matching distribution found for openh264

初学视音频编码处理,印象中OpenH264应用广泛。知道会发生什么吗?

我的设置有点不同(不使用 Jupyter notebook)但是如果你从 anaconda 提示符 运行 你的脚本 (python ) 你应该得到像这样的额外错误信息:

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

[libopenh264 @ 000001747d1b7280] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error"

我要做的就是去这里解决这个问题: https://github.com/cisco/openh264/releases

然后,下载并解压缩 openh264-1.4.0-win64msvc.dll(7-zip 用于 bz2 解码),最后将请求的 dll 放在 python 脚本所在的目录中 运行 .

使用 openCV videowriter 对象,您需要的 fourCC 代码是 "H264",然后在将视频流写入文件时使用 .mkv 文件扩展名。

希望对您有所帮助!