Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg_openvino build failed, LibAV #413

Closed
KiwiHana opened this issue Apr 24, 2024 · 8 comments
Closed

ffmpeg_openvino build failed, LibAV #413

KiwiHana opened this issue Apr 24, 2024 · 8 comments

Comments

@KiwiHana
Copy link

KiwiHana commented Apr 24, 2024

source: https://github.com/dlstreamer/dlstreamer/blob/master/samples/ffmpeg_openvino/cpp/decode_inference/build_and_run.sh

dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference$ source /opt/intel/openvino_2024/setupvars.sh
source /opt/intel/dlstreamer/setupvars.sh
[setupvars.sh] OpenVINO environment initialized
[setupvars.sh] GStreamer 1.20 framework initialized
[setupvars.sh] GStreamer 1.20 plugins path initialized
[setupvars.sh] Intel(R) DL Streamer environment initialized
test@test:~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference$ ./build_and_run.sh
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
CMake Warning at CMakeLists.txt:16 (find_package):
  By not providing "FindLIBAV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LIBAV", but
  CMake did not find one.

  Could not find a package configuration file provided by "LIBAV" with any of
  the following names:

    LIBAVConfig.cmake
    libav-config.cmake

  Add the installation prefix of "LIBAV" to CMAKE_PREFIX_PATH or set
  "LIBAV_DIR" to a directory containing one of the above files.  If "LIBAV"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "2.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/test/kiwi/dlstreamer/samples/ffmpeg_openvino_decode_inference/build
./build_and_run.sh: line 31: /home/test/kiwi/dlstreamer/samples/ffmpeg_openvino_decode_inference/build/ffmpeg_openvino_decode_inference: No such file or directory

$ ffmpeg -codecs | grep qsv
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
 DEV.L. av1                  Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv ) (encoders: libaom-av1 )
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_qsv h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid ) (encoders: libx265 nvenc_hevc hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi )
 DEVIL. mjpeg                Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv ) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi )
 DEV.L. mpeg2video           MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid ) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi )
 D.V.L. vc1                  SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid )
 DEV.L. vp8                  On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv ) (encoders: libvpx vp8_v4l2m2m vp8_vaapi )
 DEV.L. vp9                  Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv ) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv )
@KiwiHana
Copy link
Author

upgrade to ffmpeg version> 6.0, still build the same error

$ ffmpeg -v
ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --arch=x86_64 --disable-x86asm --enable-vaapi
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
Missing argument for option 'v'.
Error splitting the argument list: Invalid argument

@brmarkus
Copy link

There seems something going wrong while cmake and make.

Instead of using the build script can you call cmake and make manually (like from within the script) (after clearing the build folder)?
The shown logs in the initial description doesn't show that all dependencies were found (except one warning), and there are no log messages from the build process at all...

Maybe manually doing cmake and make steps reveal more details?

@KiwiHana
Copy link
Author

KiwiHana commented Apr 24, 2024

There seems something going wrong while cmake and make.

Instead of using the build script can you call cmake and make manually (like from within the script) (after clearing the build folder)? The shown logs in the initial description doesn't show that all dependencies were found (except one warning), and there are no log messages from the build process at all...

Maybe manually doing cmake and make steps reveal more details?

Can you give any command to debug?

@brmarkus
Copy link

From your initial description you are in the folder "~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference", then calling the build script.

Let's see to start calling the steps in the script manually, like:

(calling each command manually, not copy&pasting them together)

mkdir build
cd build
cmake .
make

The given CMake file "https://github.com/dlstreamer/dlstreamer/blob/master/samples/ffmpeg_openvino/cpp/decode_inference/CMakeLists.txt" checks dependencies:

if (LIBAV_FOUND AND OpenVINO_FOUND AND OpenCL_FOUND AND gflags_FOUND)

These 4 dependencies have to be found...
Unfortunately it doesn't mark all of them as REQUIRED in e.g. find_package(LIBAV COMPONENTS libavformat libavcodec libswscale libavutil)

From your initial description there is a Cmake-warning about "LIBAV" not found: it's a warning only because "REQUIRED" is missing (like in find_package(PkgConfig REQUIRED)).

You might need to install the development-package of libAV first.

@KiwiHana
Copy link
Author

From your initial description you are in the folder "~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference", then calling the build script.

Let's see to start calling the steps in the script manually, like:

(calling each command manually, not copy&pasting them together)

mkdir build
cd build
cmake .
make

The given CMake file "https://github.com/dlstreamer/dlstreamer/blob/master/samples/ffmpeg_openvino/cpp/decode_inference/CMakeLists.txt" checks dependencies:

if (LIBAV_FOUND AND OpenVINO_FOUND AND OpenCL_FOUND AND gflags_FOUND)

These 4 dependencies have to be found... Unfortunately it doesn't mark all of them as REQUIRED in e.g. find_package(LIBAV COMPONENTS libavformat libavcodec libswscale libavutil)

From your initial description there is a Cmake-warning about "LIBAV" not found: it's a warning only because "REQUIRED" is missing (like in find_package(PkgConfig REQUIRED)).

You might need to install the development-package of libAV first.

Each command manually like the following log.
libAV follow by ffmpeg, when I install ffmpeg, libAV will be installed.
I don't know how to install development-package of libAV. Do you have idea?

test@test:~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference/build$ source /opt/intel/openvino_2024/setupvars.sh
source /opt/intel/dlstreamer/setupvars.sh
[setupvars.sh] OpenVINO environment initialized
[setupvars.sh] GStreamer 1.20 framework initialized
[setupvars.sh] GStreamer 1.20 plugins path initialized
[setupvars.sh] Intel(R) DL Streamer environment initialized
test@test:~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference/build$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:16 (find_package):
  By not providing "FindLIBAV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LIBAV", but
  CMake did not find one.

  Could not find a package configuration file provided by "LIBAV" with any of
  the following names:

    LIBAVConfig.cmake
    libav-config.cmake

  Add the installation prefix of "LIBAV" to CMAKE_PREFIX_PATH or set
  "LIBAV_DIR" to a directory containing one of the above files.  If "LIBAV"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/test/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference/build
test@test:~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference/build$ make
test@test:~/kiwi/dlstreamer/samples/ffmpeg_openvino/cpp/decode_inference/build$ 

@brmarkus
Copy link

You probably need one (or all?) of these:

sudo apt-get install libavutil-dev libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavresample-dev libswscale-dev libswresample-dev libpostproc-dev

Start with:

sudo apt-get install libavcodec-dev

@pmalatyn
Copy link

pmalatyn commented May 6, 2024

@KiwiHana any progress with your issue? need some additional help?

@pmalatyn
Copy link

no response since 2 weeks closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants