1

I am trying to build pjsip project with openh264 lib. Everything works fine except openh264 is not being detected by pjsip ./configure-android

this is my config_site.h

/* Activate Android specific settings in the 'config_site_sample.h' */
#define PJ_CONFIG_ANDROID 1
#include <pj/config_site_sample.h>
#define PJMEDIA_HAS_VIDEO 1
#define PJMEDIA_HAS_OPENH264_CODEC 1

I am getting following log

Using OpenH264 prefix... /home/user_name/PJSIPTOOLS/openh264-1.0.0/openlib/
checking OpenH264 usability... no

As it is not detected by ./configure-android my app is crashing at runtime saying lib not found for openh264.

I am on ubuntu 14.04 32 bit.

Any suggestions.

Manoj
  • 2,799
  • 5
  • 30
  • 49
  • Strange thing is I am able to get usability ok.. using ./configure not with ./configure-android – Manoj Oct 07 '15 at 13:02

3 Answers3

6

I just encountered a similar issue. In the following, I refer to the directory, I downloaded and extracted OpenH264 to, as path-to-openh264. I created a subdirectory android within that folder and modified OpenH264's Makefile by setting PREFIX=android. Afterwards running the following commands to build OpenH264 solved the issue for me:

make OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm
make OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm clean
make install OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm

The resulting libopenh264.so file should end up in the directory path-to-openh264/android/lib/. In order to configure pjsip I used the following command:

APP_PLATFORM=android-14 ./configure-android --with-openh264=<path-to-openh264>/android

The following StackOverflow thread lead me to the right direction:

building openh264 for android platform in x86

The reason for this issue was, that I ran the make install command without the command line parameters at first. This caused the native library file to be created for the wrong ABI (the default one, which is armeabi-v7a). When building pjsip for the armeabi ABI, it didn't recognize the library, because it was built for a different ABI. At least this is what I suppose.

Community
  • 1
  • 1
Michael Rapp
  • 324
  • 3
  • 8
4

Actually i faced that problem too.

Solution:

step 1:go to your openh264 directory and create a folder named "android"

step 2: open makefile and set prefix

PREFIX=/your_path/openh264-1.0.0/android

step3:then build openh264 using this command

make OS=android NDKROOT=/your_path/android-ndk-r10d TARGET=android-17 APP_ABI=armeabi

step4: now build pjsip using this command

TARGET_ABI=armeabi APP_PLATFORM=android-12 ./configure-android --use-ndk-cflags --with-openh264=/your_path/openh264-1.0.0/android

hope this time you will see

Using OpenH264 prefix... 
/home/user_name/PJSIPTOOLS/openh264-1.0.0/openlib/
checking OpenH264 usability... ok
riaz hasan
  • 1,155
  • 2
  • 8
  • 20
3

http://trac.pjsip.org/repos/ticket/1758

  • modify the "prefix" in Makefile
  • run "make install ARCH=armeabi"
  • run "./configure-android --with_openh264=/path/to/prefix/folder"
  • I have already done above step. I have following command. TARGET_ABI=armeabi-v7a APP_PLATFORM=android-19 ./configure-android --use-ndk-cflags --with-openh264=/home/user_name/PJSIPTOOLS/openh264-1.0.0/openlib --with-libyuv=/home/user_name/PJSIPTOOLS/libyuv-android-master/jni --with-ffmpeg=/home/user_name/android-ndk-r10e/sources/ffmpeg-2.8/android/armeabi-v7a It doesnt work with this command – Manoj Oct 08 '15 at 15:30
  • run "make install OS=android NDKROOT=/path/to/android-ndk/ TARGET=android-21 APP_ABI=armeabi ARCH=arm" in openh264 folder. after, run "./configure-android --with_openh264=/path/to/prefix/folder" – Gabriel Medeiros Oct 15 '15 at 16:46
  • Tried that as well didnt work. I had to go with https://github.com/alexbbb/pjsip-android-builder project to build pjsip and I am able to do it sucessfully. – Manoj Oct 16 '15 at 09:20