How can I get FFmpeg to locate installed libraries when --sysroot is pointing to another directory?

依然范特西╮ 提交于 2019-12-04 07:22:32

Instead of changing the include paths, why don't you try copying all the libmp3lame files that were created by 'make install' to the relevant directory where the script will look for them. Insert ECHO statements to find out what exactly the PATH/CFLAGS/LDFLAGS are at the point where you get the error, and copy the files there so it does find them.

I saw you were using the project located at http://bambuser.com/opensource

I had the same problem and resolved like this:

  1. compile lame for android using https://github.com/intervigilium/liblame
  2. this is a small diff between the original build.sh from "bambuser.com" and the one I used:

    3c3,6
    <  export NDK=${HOME}/downloads/android-ndk # r8d
    ---
    > if [ "$NDK" = "" ]; then
    >     echo NDK variable not set, assuming ${HOME}/android-ndk
    >     export NDK=${HOME}/android-ndk
    > fi
    15,16c18
    < #for version in armv5te armv7a; do
    <  for version in         armv7a; do
    ---
    > for version in armv5te armv7a; do
    24c26
    <     FLAGS="$FLAGS --disable-everything --enable-libmp3lame"
    ---
    >     FLAGS="$FLAGS --disable-everything"
    
  3. from "intervigilium" project copy the folder liblame/jni/lame to PATH_TO_NDK/platforms/android-3/arch-arm/usr/include

  4. from "intervigilium" project copy liblame/libs/armeabi-v7a/liblame.so to PATH_TO_NDK/platforms/android-3/arch-arm/usr/libs and RENAME it in libmp3lame.so.
  5. finally run build.sh.
  6. you should be fine:

    install prefix            ../build/ffmpeg/armeabi-v7a
    source path               /home/samuele/downloads/ffmpeg/ffmpeg-android/ffmpeg
    C compiler                arm-linux-androideabi-gcc
    ARCH                      arm (generic)
    big-endian                no
    runtime cpu detection     no
    ARMv5TE enabled           yes
    ARMv6 enabled             yes
    ARMv6T2 enabled           yes
    ARM VFP enabled           yes
    IWMMXT enabled            no
    NEON enabled              no
    debug symbols             yes
    strip symbols             yes
    optimizations             small
    static                    yes
    shared                    yes
    postprocessing support    no
    new filter support        yes
    network support           yes
    threading support         pthreads
    SDL support               no
    Sun medialib support      no
    AVISynth enabled          no
    frei0r enabled            no
    libdc1394 support         no
    libdirac enabled          no
    libfaac enabled           no
    libgsm enabled            no
    **libmp3lame enabled        yes**
    libnut enabled            no
    libopencore-amrnb support no
    libopencore-amrwb support no
    libopencv support         no
    libopenjpeg enabled       no
    librtmp enabled           no
    libschroedinger enabled   no
    libspeex enabled          no
    libtheora enabled         no
    libvorbis enabled         no
    libvpx enabled            no
    libx264 enabled           no
    libxavs enabled           no
    libxvid enabled           no
    zlib enabled              no
    bzlib enabled             no
    
    Enabled decoders:
    
    Enabled encoders:
    mpeg2video      nellymoser
    
    Enabled hwaccels:
    
    Enabled parsers:
    
    Enabled demuxers:
    
    Enabled muxers:
    
    Enabled protocols:
    
    Enabled filters:
    buffer
    
    Enabled bsfs:
    
    Enabled indevs:
    
    Enabled outdevs:
    
    License: LGPL version 2.1 or later
    Creating config.mak and config.h...
    libavutil/avconfig.h is unchanged
    

Be aware, I still need to test the resulting FFmpeg build. To say the truth, now I have to learn how to use it in my App... ;)

EDIT: I tried removing --disable-everything and it builds OK the same, with a lot of encoders, decoders etc, but increasing to ~40MB for the build dir.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!