Skip to content Skip to sidebar Skip to footer

Build Vp8 On Android

I'm trying to build the vp8 codec for Android. I ran the configure.sh script and the makefile for armv6 with sourcery g++ which succesfully produced libvpx.so. After that I wrote a

Solution 1:

From http://git.chromium.org/gitweb/?p=webm/bindings.git;a=blob_plain;f=JNI/README.Android with some adjustments for readability.

  1. Create {project}/jni folder.

  2. Get JNI bindings.

    git clone https://chromium.googlesource.com/webm/bindings

  3. Get libvpx.

    git clone https://chromium.googlesource.com/webm/libvpx

  4. Configure libvpx for Android

    ./libvpx/configure --target=armv7-android-gcc --disable-examples --sdk-path={path to NDK}

    --sdk-path MUST be absolute.

  5. Get libwebm.

    cd bindings/JNI

    git clone https://chromium.googlesource.com/webm/libwebm

  6. Get libogg.

    Download ogg code from http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz

    Extract to bindings/JNI.

  7. We need to run configure to generate config_types.h.

    cd libogg-1.3.0 && ./configure && cd ..

  8. Get libvorbis

    Download vorbis code from http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

    Extract to bindings/JNI.

  9. Get libyuv

    svn checkout http://libyuv.googlecode.com/svn/trunk/ libyuv-read-only

  10. Create {project}/jni/Application.mk with the data below:

    APP_ABI := armeabi-v7a
    APP_OPTIM := release
    APP_STL := gnustl_static
    APP_CPPFLAGS := -frtti
    
  11. Create {project}/jni/Android.mk with the data below:

    WORKING_DIR := $(call my-dir)
    BINDINGS_DIR := $(WORKING_DIR)/bindings/JNI
    include$(BINDINGS_DIR)/Android.mk
    
  12. Build the JNI code.

    {path to NDK}/ndk-build

  13. Copy the java code.

    cp -R bindings/JNI/com/google ../src/com/

  14. Add code to test the bindings.

    int[] major = newint[2];
    int[] minor = newint[2];
    int[] build = newint[2];
    int[] revision = newint[2];
    MkvMuxer.getVersion(major, minor, build, revision);
    String outStr = "libwebm:" +
                    Integer.toString(major[0]) + "." +
                    Integer.toString(minor[0]) + "." +
                    Integer.toString(build[0]) + "." +
                    Integer.toString(revision[0]);
    System.out.println(outStr);
    
  15. Run the app. You should see libwebm version output.

  16. Tweak as needed. VP8 wrappers are in the com.google.libvpx namespace.

Solution 2:

This can sometimes be a problem with the SONAME in a shared library, have a look at this article.

http://groups.google.com/group/android-ndk/browse_thread/thread/fd484da512650359

You could disable pthreads if you don't really need them.

Iv'e had problems with .so files in the past and have avoided all of these problems by using .a static libraries instead of .so shared libraries

Post a Comment for "Build Vp8 On Android"