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

Building #17

Open
bkatgithub opened this issue Apr 29, 2018 · 4 comments
Open

Building #17

bkatgithub opened this issue Apr 29, 2018 · 4 comments

Comments

@bkatgithub
Copy link

bkatgithub commented Apr 29, 2018

Hi Madhavan,

I tried specifying vcodec libx264 and it caused a crash. I realized that I might have to
do a custom build with this codec. I am trying to do that using the instructions
in your blog (https://medium.com/madhavanmalolan/ffmpeg-for-android-b307f2613c82).
I am getting an error (shown below) when I do the ndk-build.

Before I start debugging it, I wanted clarification on something in the build instructions.
In the section titled "Compiling source" you say "Copy the following files from
/path/to/ffmpeg to the jni/ directory". Where should the "jni" directory be created?
I tried creating it in the android project directory at the same level as the 'app' directory (based
on what you say further down in the instructions to cd /path/to/app/jni).
I also tried placing it in the app/src/main directory.

I am using ffmpeg 2.8.13 and android-ndk-r12b

Thanks for putting this out for everybody!

Did I miss something that is causing this error?

Bcs-MacBook-Pro:jni bc$ /Users/bc/projects/android/android-ndk-r12b/ndk-build Android NDK: WARNING: Ignoring unknown import directory: /Users/bc/tmp/android/MediaCodecTest/app/src/main/jni Android NDK: /Users/bc/tmp/android/MediaCodecTest/app/src/jni/Android.mk: Cannot find module with tag '../../../../../../../projects/android/ffmpeg-2.8.13/android/arm' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched: Android NDK: /Users/bc/tmp/android/MediaCodecTest/app/src/jni/Android.mk:14: *** Android NDK: Aborting. . Stop.

@madhavanmalolan
Copy link
Owner

The JNI folder should be inside app/src/main

@bkatgithub
Copy link
Author

Thanks Madhavan for the clarification. It helped me get past the error I was seeing.

However, I am seeing this error now. I googled it and found a mention about specifying abiFilters (https://stackoverflow.com/questions/37508876/android-ndk-ffmpeg-unknown-mnemonic-error). But doing this did not help with the error. Do you happen to know what the problem here is?

Thanks.

Bcs-MacBook-Pro:jni bc$ /Users/bc/projects/android/android-ndk-r12b/ndk-build [arm64-v8a] Compile : ffmpeg <= ffmpeg_controller.c [arm64-v8a] Compile : ffmpeg <= ffmpeg.c /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s: Assembler messages: /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8554: Error: unknown mnemonic itt' -- itt gt' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8555: Error: unknown mnemonic movgt' -- movgt x25,x0' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8556: Error: unknown mnemonic movgt' -- movgt x0,x1' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8558: Error: unknown mnemonic it' -- it le' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8559: Error: unknown mnemonic movle' -- movle x0,x2' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8561: Error: unknown mnemonic it' -- it gt' /var/folders/lw/psryh7r92d9djvtltkfrjgz80000gn/T//cc5pthx0.s:8562: Error: unknown mnemonic movgt' -- movgt x25,x0' make: *** [/Users/bc/tmp/android/MediaCodecTest/app/src/main/obj/local/arm64-v8a/objs/ffmpeg/ffmpeg.o] Error 1

@madhavanmalolan
Copy link
Owner

Can you give me the following information :

  1. What is the FFMPEG version you are trying to build?
  2. Can you show me your build.sh?

@bkatgithub
Copy link
Author

I am working with ffmpeg v 2.8.13 and ndk r12b.

The build file

`
#!/bin/bash
NDK=/Users/bc/projects/android/android-ndk-r12b
SYSROOT=$NDK/platforms/android-14/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64

function build_one
{
./configure
--prefix=$PREFIX
--enable-shared
--disable-static
--disable-doc
--disable-ffmpeg
--disable-ffplay
--disable-ffprobe
--disable-ffserver
--disable-doc
--disable-symver
--enable-protocol=concat
--enable-protocol=file
--enable-muxer=mp4
--enable-demuxer=mpegts
--enable-memalign-hack
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi-
--target-os=linux
--arch=arm
--enable-cross-compile
--sysroot=$SYSROOT
--extra-cflags="-Os -fpic $ADDI_CFLAGS"
--extra-ldflags="$ADDI_LDFLAGS"
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j3
make install
}

CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
`

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

2 participants