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

ERROR: aom >= 0.1.0 not found using pkg-config #1688

Closed
Duna opened this issue Feb 17, 2021 · 12 comments
Closed

ERROR: aom >= 0.1.0 not found using pkg-config #1688

Duna opened this issue Feb 17, 2021 · 12 comments

Comments

@Duna
Copy link

Duna commented Feb 17, 2021

ERROR: aom >= 0.1.0 not found using pkg-config

I am following this tutorial: https://github.com/gpac/gpac/wiki/GPAC-Build-Guide-for-Android

<GPAC_ROOT_DIR>/deps_android/build/android$ ./gpac_build_all_extra_libs /opt/android-ndk

Using Ubuntu 18 x64

@aureliendavid
Copy link
Member

aureliendavid commented Feb 17, 2021

hard to tell with just one line, can you post the whole output of the command?

aom is build by the script in libaom/build_libaom_android.sh you can try just this one to see if it works

it's then used by build/android/build_ffmpeg4.sh which tells pkg-config where to find libaom using environment variables here: https://github.com/gpac/deps_android/blob/master/build/android/build_ffmpeg4.sh#L59

EDIT: sorry I thought you were using macos

@Duna
Copy link
Author

Duna commented Feb 17, 2021

root@duna-VirtualBox:/home/duna# cd deps_android
root@duna-VirtualBox:/home/duna/deps_android# ls
build faad2 freetype libaom libmad OpenJPEG zlib
CopyLibs2Public4Android.sh ffmpeg-4.0.2 js libjpg libpng real3d.jar
root@duna-VirtualBox:/home/duna/deps_android# git submodule update --init --recursive --force --checkout
Submodule path 'OpenJPEG': checked out '55efc4e136a3273520ef9fead4e3a9cd7501ed9f'
Submodule path 'faad2': checked out 'e799350230da5c1875e8ab090566063fb6133e30'
Submodule path 'freetype': checked out 'c1fb064ec9bc49b5193618b1175448df7920f884'
Submodule path 'js': checked out '451aa36b409eb55f1f829ac5db84d30d9a1a4070'
Submodule path 'libjpg': checked out 'ce53e6c6c754f5706fec1b3ecb548bf0d4b9d83b'
Submodule path 'libmad': checked out '8846a59f79b26c278236c1f0139a9cd3278658db'
Submodule path 'libpng': checked out '3938dccf707b3afb72d3cbb89d58d24f34f2dee5'
Submodule path 'zlib': checked out '2666c5144451579380df4b73d7190e3f2822ad06'
root@duna-VirtualBox:/home/duna/deps_android# cd build/android/
root@duna-VirtualBox:/home/duna/deps_android/build/android#
root@duna-VirtualBox:/home/duna/deps_android/build/android# ./gpac_build_all_extra_libs /opt/android-ndk
Note: if you have problem using this script read the README in trunk/gpac/build/android
Compiling FFMPEG for Android...
--- Building libaom ---

  • [ ! -d aom ]
  • cd aom
  • git checkout cf38e96db7664ae82d8d67287fa0c4a60b44473b
    HEAD is now at cf38e96db Make ss_size lookup same as the spec
  • cd ..
  • ABIS=armeabi-v7a x86
  • mkdir armeabi-v7a
    mkdir: cannot create directory ‘armeabi-v7a’: File exists
  • cd armeabi-v7a
  • [ = rebuild ]
  • [ ! -f Makefile ]
  • cmake ../aom -DCMAKE_TOOLCHAIN_FILE=../armeabi-v7a-android.cmake
    ./build_libaom_android.sh: 26: ./build_libaom_android.sh: cmake: not found
  • make aom
    ./build_libaom_android.sh: 29: ./build_libaom_android.sh: make: not found
  • cd ..
  • mkdir x86
    mkdir: cannot create directory ‘x86’: File exists
  • cd x86
  • [ = rebuild ]
  • [ ! -f Makefile ]
  • cmake ../aom -DCMAKE_TOOLCHAIN_FILE=../x86-android.cmake
    ./build_libaom_android.sh: 26: ./build_libaom_android.sh: cmake: not found
  • make aom
    ./build_libaom_android.sh: 29: ./build_libaom_android.sh: make: not found
  • cd ..
  • pwd
  • pwd
  • pwd
  • pwd
  • pwd
  • pwd
  • cat
  • pwd
  • pwd
  • pwd
  • pwd
  • pwd
  • pwd
  • cat
  • set +x
    patching file ffmpeg-4.0.2/configure
    Configuring ...
    ERROR: aom >= 0.1.0 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
root@duna-VirtualBox:/home/duna/deps_android/build/android#

Fill log is here

@aureliendavid
Copy link
Member

  • ./build_libaom_android.sh: 26: ./build_libaom_android.sh: cmake: not found
    ./build_libaom_android.sh: 29: ./build_libaom_android.sh: make: not found

ok this wasn't mentioned in the guide I admit, but without make and cmake this won't work

try running

sudo apt install build-essential make cmake

and re-run the script after that

@Duna
Copy link
Author

Duna commented Feb 17, 2021

sudo apt-get install -y yasm - missing

@Duna
Copy link
Author

Duna commented Feb 17, 2021

Another log:

[100%] Built target aom
+ cd ..
+ mkdir x86
mkdir: cannot create directory ‘x86’: File exists
+ cd x86
+ [  = rebuild ]
+ [ ! -f Makefile ]
+ make aom
[  1%] Updating version info if necessary.
[  1%] Built target aom_version_check
[  1%] Built target aom_version
[  3%] Built target aom_rtcd
[ 15%] Built target aom_av1_common
[ 17%] Built target aom_dsp_common_sse2_intrinsics
[ 18%] Built target aom_dsp_encoder_sse2_intrinsics
[ 24%] Built target aom_av1_common_avx2_intrinsics
[ 25%] Built target aom_util
[ 29%] Built target aom_av1_common_ssse3_intrinsics
[ 29%] Built target aom_av1_encoder_sse42_intrinsics
[ 31%] Built target aom_av1_encoder_sse2_intrinsics
[ 32%] Built target aom_scale
[ 36%] Built target aom_dsp_encoder_avx2_intrinsics
[ 37%] Built target aom_av1_common_sse2_intrinsics
[ 41%] Built target aom_av1_encoder_sse4_intrinsics
[ 58%] Built target aom_av1_encoder
[ 60%] Built target aom_dsp_encoder_sse4_1_intrinsics
[ 62%] Built target aom_dsp_common_ssse3_intrinsics
[ 63%] Built target aom_dsp_decoder
[ 65%] Built target aom_av1_decoder
[ 68%] Built target aom_dsp_common_avx2_intrinsics
[ 74%] Built target aom_av1_common_sse4_intrinsics
[ 79%] Built target aom_dsp_encoder
[ 82%] Built target aom_av1_encoder_avx2_intrinsics
[ 82%] Built target aom_mem
[ 84%] Built target aom_dsp_encoder_ssse3_intrinsics
[ 87%] Built target aom_dsp_common
[ 89%] Built target aom_dsp_common_sse4_1_intrinsics
[ 89%] Built target aom_dsp
[100%] Built target aom
+ cd ..
+ pwd
+ pwd
+ pwd
+ pwd
+ pwd
+ pwd
+ cat
+ pwd
+ pwd
+ pwd
+ pwd
+ pwd
+ pwd
+ cat
+ set +x
patching file ffmpeg-4.0.2/configure
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Configuring ...
ERROR: aom >= 0.1.0 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

@aureliendavid
Copy link
Member

do you have pkg-config installed? if not sudo apt install pkg-config

you can also add a "set -x" at line 2 of build/android/build_ffmpeg4.sh to see exactly what it's doing

@Duna
Copy link
Author

Duna commented Feb 17, 2021

[OK] success Building osmo4 apk

Thank @aureliendavid for your help, you saved my android project!

@Duna Duna closed this as completed Feb 17, 2021
@Duna
Copy link
Author

Duna commented Feb 17, 2021

One more question: which is the mp4box .so file library? I am trying to run a command line in android like this:
MP4Box -crypt drm.xml legend.mp4 -out legend_enc.mp4

@aureliendavid
Copy link
Member

afaik MP4Box command line is currently not built on android, only the Osmo4/MP4Client player is built

if you have the libgpac library you can use it in your own ndk project or you can try to build mp4box for android directly

(you can look in https://github.com/gpac/gpac/tree/master/build/android to see how it's done for libgpac and MP4Client)

@Duna
Copy link
Author

Duna commented Feb 17, 2021

drm.xml


<GPACDRM type="CENC AES-CTR">
  <DRMInfo type="pssh" version="1">
    <BS ID128="1077efecc0b24d02ace33c1e52e2fb4b"/>
    <BS bits="32" value="1"/>
    <BS ID128="cd7eb9ff88f34caeb06185b00024e4c2"/>
  </DRMInfo>
  <CrypTrack IV_size="8" first_IV="0xbb5738fe08f11341" isEncrypted="1" saiSavedBox="senc" trackID="1">
    <key KID="0xcd7eb9ff88f34caeb06185b00024e4c2" value="0x63cb5f7184dd4b689a5c5ff11ee6a328"/>
  </CrypTrack>
</GPACDRM>

@rbouqueau
Copy link
Member

I wrote this 10 years ago:
https://github.com/gpac/gpac/blob/master/applications/mp4box_android/src/com/enst/mp4box/mp4box.java

I haven't followed on the gpac android support since then.

There is zero reason why mp4box would not build right away (following @aureliendavid instructions).

@Duna
Copy link
Author

Duna commented Feb 17, 2021

I understand, the main issue is here: gpac/applications/mp4box_android/jni/ - mp4box.so + other libs are missing + Android Studio does not recognise this type of project. As I said the prize stays for an updated project compatible with latest Android Studio: 4.1 I managed to compile this list of so files but it seems that is not the encoder libs only the player ones as @aureliendavid said

@rbouqueau The output libs

-rwxr-xr-x 1 adavid adavid 17571708 avril  2 14:12 libavcodec.so*
-rwxr-xr-x 1 adavid adavid    51200 avril  2 14:12 libavdevice.so*
-rwxr-xr-x 1 adavid adavid  1829656 avril  2 14:12 libavfilter.so*
-rwxr-xr-x 1 adavid adavid  2176896 avril  2 14:12 libavformat.so*
-rwxr-xr-x 1 adavid adavid   292208 avril  2 14:12 libavutil.so*
-rwxr-xr-x 1 adavid adavid    30444 avril  2 14:12 libeditline.so*
-rwxr-xr-x 1 adavid adavid   299436 avril  2 14:12 libfaad.so*
-rwxr-xr-x 1 adavid adavid   374168 avril  2 14:12 libft2.so*
-rwxr-xr-x 1 adavid adavid   169368 avril  2 14:12 libjpegdroid.so*
-rwxr-xr-x 1 adavid adavid   900380 avril  2 14:12 libjs_osmo.so*
-rwxr-xr-x 1 adavid adavid    99736 avril  2 14:12 libmad.so*
-rwxr-xr-x 1 adavid adavid   130148 avril  2 14:12 libopenjpeg.so*
-rwxr-xr-x 1 adavid adavid   169420 avril  2 14:12 libpng.so*
-rwxr-xr-x 1 adavid adavid   558296 avril  2 14:12 libstlport_shared.so*
-rwxr-xr-x 1 adavid adavid    83236 avril  2 14:12 libswresample.so*
-rwxr-xr-x 1 adavid adavid   365860 avril  2 14:12 libswscale.so*
-rwxr-xr-x 1 adavid adavid    83412 avril  2 14:12 libz.so*

do not match with Android ones:

  synchronized static Map<String, Throwable> loadAllLibraries() 
...
                             "jpeg", "javaenv", 
                             "mad", "editline", "ft2", 
                             "js_osmo", "openjpeg", "png", "z", 
                             "ffmpeg", "faad", "gpac",
                             "stdc++", "mp4box" }; 

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