libVLC on Ubuntu - No package 'libavcodec' found

This forum is about all development around libVLC.
mohru_mo
New Cone
New Cone
Posts: 7
Joined: 25 Jun 2020 19:07

libVLC on Ubuntu - No package 'libavcodec' found

Postby mohru_mo » 26 Jun 2020 08:47

Hi!
For a few days I've been trying to build libVLC for Android, unfortunately without any success.
I'm using an Ubuntu 20.04 live usb, and have been following instructions from https://wiki.videolan.org/AndroidCompile/
After solving many other issues, now I'm stuck at missing libavcodec problem.

The result of the

Code: Select all

buildsystem/compile.sh -l -a all -r
is as follows:

Code: Select all

VLC source: found sources, leaving untouched VLC sources: Checking TESTED_HASH and patches presence NOTE: checks can be bypass by adding '-b' option to this script. Checking presence of patch ../libvlc/patches/vlc3/0001-compat-Workaround-sendmsg-bug-on-android.patch Checking presence of patch ../libvlc/patches/vlc3/0002-libvlc-events-Add-callbacks-for-record.patch Checking presence of patch ../libvlc/patches/vlc3/0003-network-tls-Handle-errors-from-older-kernels.patch Checking presence of patch ../libvlc/patches/vlc3/0004-access_output-file-Add-error-dialog-for-write-open.patch Checking presence of patch ../libvlc/patches/vlc3/0005-libvlc-media_player-Add-record-method.patch Configuring ABI: armeabi-v7a API: 17 PATH: /home/ubuntu/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/android-sdk/platform-tools:/home/ubuntu/android-sdk/cmdline-tools/tools VLC_CFLAGS: -g -O2 -fPIC -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -DNDEBUG VLC_CXXFLAGS: -fexceptions -frtti Building tools protoc too old To-be-built packages: protoc You are ready to build VLC and its contribs make: '.gas' is up to date. Building the contribs Generating EGL pkg-config file Generating GLESv2 pkg-config file Guessing build system... x86_64-linux-gnu Packages licensing... GPL version 3, with advertisement clauses Creating configuration file... config.mak Bootstrap completed. /bin/sh: 1: arm-linux-androideabi-gcc: not found /bin/sh: 1: arm-linux-androideabi-gcc: not found /bin/sh: 1: arm-linux-androideabi-gcc: not found Run "make" to start compilation. /*some rather not important stuff*/ -- The C compiler identification is Clang 9.0.8 -- Check for working C compiler: /home/ubuntu/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi17-clang -- Check for working C compiler: /home/ubuntu/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi17-clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Looking for pow in m -- Looking for pow in m - found -- Trying SIMD32 C flags: -mfpu=neon -mfloat-abi=hard -- Performing Test DETECT_SIMD32_C_FLAGS -- Performing Test DETECT_SIMD32_C_FLAGS - Failed -- Trying SIMD32 C flags: -mfpu=neon -mfloat-abi=softfp -- Performing Test DETECT_SIMD32_C_FLAGS -- Performing Test DETECT_SIMD32_C_FLAGS - Success -- Found SIMD32: -mfpu=neon -mfloat-abi=softfp -- Could NOT find SIMD64 (missing: SIMD64_C_FLAGS SIMD64_C_FLAGS) -- Found PkgConfig: pkg-config (found version "0.29.1") -- Checking for module 'libavcodec' -- No package 'libavcodec' found CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message): A required package was not found Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal) CMakeLists.txt:132 (pkg_check_modules) -- Configuring incomplete, errors occurred! See also "/media/ubuntu/casper-rw/home/ubuntu/Desktop/libVLC/vlc-android/vlc/contrib/contrib-android-arm-linux-androideabi/soxr/CMakeFiles/CMakeOutput.log". See also "/media/ubuntu/casper-rw/home/ubuntu/Desktop/libVLC/vlc-android/vlc/contrib/contrib-android-arm-linux-androideabi/soxr/CMakeFiles/CMakeError.log". make: *** [../../contrib/src/soxr/rules.mak:33: .soxr] Error 1
From CMakeError.log I get

Code: Select all

/home/ubuntu/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: CMakeFiles/cmTC_7415c.dir/src.c.obj uses VFP register arguments, output does not clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [CMakeFiles/cmTC_7415c.dir/build.make:87: cmTC_7415c] Error 1 make[2]: Leaving directory '/media/ubuntu/casper-rw/home/ubuntu/Desktop/libVLC/vlc-android/vlc/contrib/contrib-android-arm-linux-androideabi/soxr/CMakeFiles/CMakeTmp' make[1]: *** [Makefile:121: cmTC_7415c/fast] Error 2
But I guess this one is solved by -mfpu=neon -mfloat-abi=softfp

I don't understand why libavcodec cannot be found. I've installed it separately using

Code: Select all

sudo apt-get install libavcodec-dev
and when I run

Code: Select all

pkg-config --modversion libavcodec
I get 58.54.100

I've exported PKG_CONFIG_PATH to

Code: Select all

/usr/lib/x86_64-linux-gnu/pkgconfig
(this is where my libavcodec is located), but still I get this info that No package 'libavcodec' found

Any hint what may be the problem here? I'm rather a Ubuntu noob, so please use simple language :)

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: libVLC on Ubuntu - No package 'libavcodec' found

Postby chubinou » 26 Jun 2020 10:19

> sudo apt-get install libavcodec-dev

you installed avcodec for your host system. what is missing is avcodec for android. It's supposed to be compiled during the build (within vlc "contribs")

mohru_mo
New Cone
New Cone
Posts: 7
Joined: 25 Jun 2020 19:07

Re: libVLC on Ubuntu - No package 'libavcodec' found

Postby mohru_mo » 26 Jun 2020 10:54

I understand. So for some reason it's not being compiled during the build. There is no libavcodec pkgconfig folder in the vlc/contrib folder.

Or maybe the real problem is not with libavcodec, but with Could NOT find SIMD64 (missing: SIMD64_C_FLAGS SIMD64_C_FLAGS) ? (I've got no idea what it means)

I haven't changed anything in the source code I downloaded. Any hint what else can I do here?

mohru_mo
New Cone
New Cone
Posts: 7
Joined: 25 Jun 2020 19:07

Re: libVLC on Ubuntu - No package 'libavcodec' found

Postby mohru_mo » 03 Jul 2020 09:49

Most probably I've foud a solution to my problem (not sure if this is sufficient as I'm still having some other issues).

It turns out that for some reason the cmake hasn't recognized my system as unix (it's Ubuntu on live USB) and in the cmake config file the flag UNIX was not set which caused that PKG_CONFIG_PATH was formatted with `;` not with `:` and therefore was not valid.
I set that UNIX flag manually in the contrib/{platform}/soxr/CMakeList.txt before calling pkg_check_modules. This seems to eliminate this particular problem. However, I'm not sure why this flag wasn't set in the first place...


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests