【问题标题】:libavcodec 56 not found even though it is installed即使安装了 libavcodec 56 也找不到
【发布时间】:2018-11-14 00:53:21
【问题描述】:

当我尝试在 Ubuntu 18.04 中编译英特尔 OpenVino 项目时,我不断收到此错误消息:warning: libavcodec-ffmpeg.so.56, needed by /opt/intel/computer_vision_sdk_2018.3.343/opencv/lib/libopencv_videoio.so.3.4.3, not found

我也收到类似的错误消息:libavformat-ffmpeg.so.56libavutil-ffmpeg.so.54libswscale-ffmpeg.so.3

但是,当我在终端中输入 ffmpeg 时,我得到:

ffmpeg version 2.7.7 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04) configuration:
    libavutil 54. 27.100 / 54. 27.100
    libavcodec 56. 41.100 / 56. 41.100
    libavformat 56. 36.100 / 56. 36.100
    libavdevice 56. 4.100 / 56. 4.100
    libavfilter 5. 16.101 / 5. 16.101
    libswscale 3. 1.101 / 3. 1.101
    libswresample 1. 2.100 / 1. 2.100 Hyper fast Audio and Video encoder

我有所有正确的版本。 ffmpeg 位于 /usr/local/bin 中。为什么 OpenVino 看不到?任何建议将不胜感激,在此先感谢!

这是我要编译的项目:https://github.com/intel-iot-devkit/intruder-detector

【问题讨论】:

    标签: linux ffmpeg computer-vision intel openvino


    【解决方案1】:

    似乎期待来自 Ubuntu 16.04 ffmpeg 包的文件,Ubuntu 打包为 libavcodec-ffmpeg.so.56 等(当前的 Ubuntu 使用标准名称,例如 libavcodec.so.57。)

    您在没有配置选项的情况下编译了 ffmpeg,但对于 .so 文件,您需要 --enable-shared

    您可以使用--enable-shared 编译FFmpeg 2.8 发布分支,它将提供libavcodec.so.56 等。注意名称差异:libavcodec.so.56libavcodec-ffmpeg.so.56。如果这会导致问题,您将不得不处理它。我会首先参考./configure --help 或您正在编译的任何内容。

    【讨论】:

    • 非常感谢!这行得通。我添加了标志 --build_suffix=-ffmpeg ,它就像一个魅力。它停止抱怨共享文件不存在,但我现在收到类似于以下内容的错误:/opt/intel/computer_vision_sdk_2018.3.343/opencv/lib/libopencv_videoio.so.3.4.3: undefined reference to `av_write_trailer@LIBAVFORMAT_FFMPEG_56 '。如果我已经有了正确的版本,我不明白为什么它仍然存在问题。任何建议将不胜感激。
    • @Hegerber 你编译的是什么版本的FFmpeg?
    • @hegerber 抱歉,我对 OpenCV 一无所知。如问题所示,我的答案是解决缺少 FFmpeg .so 文件的问题。考虑对每个新问题提出一个新问题。
    【解决方案2】:

    您的链接器抱怨找不到动态库。您需要找出这些共享对象在哪里以及链接器在哪里搜索它们。

    ldconfig -v 2>/dev/null |grep -v ^$'\t'
    # ldconfig is a tool for configure linker search path
    # This command will tell you where it is searching for the necessay libs.
    

    我猜你的库可能在/usr/local/lib 并且链接器没有搜索到这个目录。

    如果是这样,请尝试在/etc/ld.so.conf.d 下创建一个包含该目录的文件,例如/etc/ld.so.conf.d/local.conf。 然后sudo ldconfig 并尝试再次构建您的项目。

    【讨论】:

    • 谢谢,它让我更好地了解了在哪里看。但是,我注意到在任何地方都找不到 *.so.56 文件。我使用 tar 而不是 apt 安装了 ffmpeg。我尝试使用 apt 一次,但我只得到 *.so.57 文件,这是不正确的版本。关于如何使用 apt 安装旧 56 版本的任何建议?
    • 我猜a tar 意味着所有库都是静态链接并打包到一个大二进制文件ffmeg 中。旧版本?从源码编译~
    猜你喜欢
    • 2014-10-26
    • 1970-01-01
    • 2021-12-15
    • 2021-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 2020-07-10
    相关资源
    最近更新 更多