0

I keep getting this error message when I try to compile an Intel OpenVino project in Ubuntu 18.04: 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

I also get similar error messages for: libavformat-ffmpeg.so.56, libavutil-ffmpeg.so.54, and libswscale-ffmpeg.so.3.

However, when I type ffmpeg in the terminal, I get:

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

I have all the correct versions. The ffmpeg is in /usr/local/bin. Why can't OpenVino see it? Any advice will be appreciated, thanks in advance!

Here's the project I'm trying to compile: https://github.com/intel-iot-devkit/intruder-detector

E_net4
  • 27,810
  • 13
  • 101
  • 139
hegerber
  • 201
  • 2
  • 13

2 Answers2

2

It seems to be expecting files from the Ubuntu 16.04 ffmpeg package which Ubuntu packaged as libavcodec-ffmpeg.so.56, etc. (Current Ubuntu uses the standard names such as libavcodec.so.57.)

You compiled ffmpeg with no configure options, but you need --enable-shared for the .so files.

You could compile the FFmpeg 2.8 release branch with --enable-shared, and it will provide libavcodec.so.56, etc. Note the name difference: libavcodec.so.56 vs libavcodec-ffmpeg.so.56. If that causes problems you'll have to deal with that. I'd start by referring to the ./configure --help or equivalent of whatever you're compiling.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • Thanks a bunch! This worked. I added the flag --build_suffix=-ffmpeg and it worked like a charm. It stopped complaining about the shared file not existing, but I'm getting errors similar to the following now: /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'. I don't get why it still has issues if I have the correct version already. Any advice will be appreciated. – hegerber Nov 14 '18 at 18:13
  • @Hegerber What version of FFmpeg did you compile? – llogan Nov 14 '18 at 18:49
  • @hegerber Sorry, but I don't know anything about OpenCV. My answer was addressing the lack of FFmpeg `.so` files as shown in the question. Consider asking a new question per new issue. – llogan Nov 14 '18 at 21:44
1

Your linker is complaining about failing to find dynamic libs. You need to find out where those shared objects are and where your linker is searching for them.

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.

I guess your libs may be in /usr/local/lib and this directory is not searched by linker.

If so, try to create a file containing that directory under /etc/ld.so.conf.d, say like /etc/ld.so.conf.d/local.conf. Then sudo ldconfig and try to build your project again.

halfelf
  • 9,737
  • 13
  • 54
  • 63
  • Thanks, it gave me a better idea of where to look. However, I noticed that there was no *.so.56 file anywhere to be found. I intalled ffmpeg using a tar instead of apt. I tried using apt once, but I only got *.so.57 files, which are the incorrect version. Any advice as to how I can use apt to install the old 56 version? – hegerber Nov 14 '18 at 02:57
  • I guess `a tar` means all libs are static linked and packed into a big binary `ffmeg` file. Older version? Compile it from source~ – halfelf Nov 14 '18 at 03:37