arm-linux-androideabi-gcc is unable to create an executable - compile ffmpeg for android armeabi devices

做~自己de王妃 提交于 2019-11-28 06:33:17
William Seemann

I'm not sure if this is what you are looking but I created a script in order to build FFmpeg 0.11.1 for Android. I modified the scripts provided with older Bambuser FFmpeg builds in order to get them working with 0.11.1. I'm currently using this script to build FFmpeg in my own application so I know the build works. The script located at http://servestream.sourceforge.net/build-ffmpeg.sh. I'm using android-ndk-r8b and Ubuntu 12.04 (x64) to do the building. In order to use the script do the following:

1.) Download the script
2.) Open the script and modify the PACKAGE variable to match application's package
3.) Make it executable: chmod +x build-ffmpeg.sh
4.) Set the NDK variable used by the script, for example: export NDK=/home/user/android-ndk-r8b
5.) Run the script: ./build-ffmpeg.sh

The compiled binaries will be located in the newly created "final-builds" folder in the current working directory. (Note: the script builds binaries for armeabi, armeabi-v7a and x86 architectures)

I hope this answers your question.

UPDATE:

If script isn't found, http://sourceforge.net/p/servestream/code/HEAD/tree/ffmpeg/scripts/arm-build.sh

I finally found the problem with my setup when facing this same issue... Looking at the arm-build.sh script, I started following the script. Notice the "TOOLCHAIN=..." path.

Originally the path was: TOOLCHAIN=echo $NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/*-x86

When I went to verify this path exists, I noticed that it did not. I think the reason is that I have a 64-bit build.

My path is actually: .../toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64

What I ended up doing was copying the folder, and renaming it to "linux-x86" and now all is compiling.

Hope this helps someone!

I got a similar error (C compiler test failed) while trying to build ffmpeg using r8d ndk version and also r8b.

The problem I later found out was that "Extract here" option on latest ubuntu seems to have some bug. It does not extract everything. So, using 'tar -jxf ' extracts properly and you will see more executables in the bin folder.

You could check this out for reference. http://code.google.com/p/android/issues/detail?id=41187

In my case, I was trying to build exoplayer's ffmpeg extension. It's not able to build with current versions of the NDK (gcc was removed in NDK 18b), so you have to revert to NDK 15c.

See here: https://github.com/google/ExoPlayer/issues/4940

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