Use build_libstagefright in ffmpeg to build file .so for android
In order to use ffmpeg in android , I tried to build ffmpeg by using build_libstagefright in ffmpeg/tools/lib_stagefright but it alwalys appear a error which i coundn't solve it. the message in the bottom of ffmpeg/config.log is arm-linux-androideabi-g++ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/base/media/libstagefright -I../android-source/frameworks/base/include/media/stagefright/openmax -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/include -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon -march=armv7-a -std=c99 -fomit-frame-pointer -fPIC -marm -Wno-multichar -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -c -o /tmp/ffconf.6ZzEMs87.o /tmp/ffconf.5jbfvJxK.cpp ./configure: line 701: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: cannot execute binary file ERROR: libstagefright_h264 not found my Build Environment is 1. Window 7 2. Cygwin 3. android-NDK-r8b linux version Tom
On Tue, 06 Nov 2012 09:19:49 -0000, hsu tom <cherish48624@gmail.com> wrote:
/home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: cannot execute binary file
Does this file exist, and is it executable according to Cygwin? -- Rhodri James Kynesim Ltd
hsu tom <cherish48624 <at> gmail.com> writes:
my Build Environment is
1. Window 7 2. Cygwin ^^^^^^ 3. android-NDK-r8b linux version ^^^^^
One of us is very seriously misunderstand something: Are you really trying to execute a linux binary on Windows? Carl Eugen
To James home/user/android-ndk/**toolchains/arm-linux-**androideabi-4.4.3/prebuilt/** linux-x86/bin/arm-linux-**androideabi-g++ This File is indeed exist. To Carl One of us is very seriously misunderstand something: Are you really trying to execute a linux binary on Windows? Yes, I'm still make use of Cygwin to build ffmpeg. ------------------------------------------------------------------------------------------ I found a method ,let me cross this error. In file of ffmpeg/configure origin : enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h fixed : enabled libstagefright && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h ^^^^^^^^^^^^^^^^^^^^ When I fix libstagefright_h264 to libstagefright here, it seems be normal until the next error. CC libavcodec/lagarithrac.o CC libavcodec/latm_parser.o CXX libavcodec/libstagefright.o /bin/sh: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: cannot execute binary file CC libavcodec/lcldec.o common.mak:51: recipe for target `libavcodec/libstagefright.o' failed make: *** [libavcodec/libstagefright.o] Error 126 make: *** Waiting for unfinished jobs.... PS: ffmpeg version is 1.0 2012/11/7 Carl Eugen Hoyos <cehoyos@ag.or.at>
hsu tom <cherish48624 <at> gmail.com> writes:
my Build Environment is
1. Window 7 2. Cygwin ^^^^^^ 3. android-NDK-r8b linux version ^^^^^
One of us is very seriously misunderstand something: Are you really trying to execute a linux binary on Windows?
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
-- Best regards from Tom
hsu tom <cherish48624 <at> gmail.com> writes:
my Build Environment is
1. Window 7 2. Cygwin 3. android-NDK-r8b linux version
I will try again since my first answer seem to have been too subtle: You claim that you are trying to use the Linux version of the Android NDK (that is point 3 of above mail). The NDK contains - among other things - a compiler, that is an executable that reads c (c++) files and compiles them. If this executable was made for Linux (and you claim so), it will not work on Windows. Carl Eugen
hi Carl You are right, Carl. This time, I change my OS to Ubuntu, and it's work. It had built successfully, and produce 5 static library(*.a). But I still have 2 questions .... In file of ffmpeg/configure origin : enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h fixed : enabled libstagefright && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h I fix the ffmpeg/configure, and build the ffmpeg source code to static library ".a". Is that ok?? Another question when I use gcc command to build share library, like this, gcc -shared -o libffmpeg.so -W1,--whole-archive ffmpeg/libavformat/libavformat.a ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a ffmpeg/libpostproc/libpostproc.a ffmpeg/libswscale/libswscale.a -W1,--no-whole-archive It works, and get a file "libffmpeg.so". This file only have 47kb, it look like too small. Is this method right or not?? PS: ffmpeg version is 1.0 PS2: Thanks a lot, Carl Tom 2012/11/7 Carl Eugen Hoyos <cehoyos@ag.or.at>
hsu tom <cherish48624 <at> gmail.com> writes:
my Build Environment is
1. Window 7 2. Cygwin 3. android-NDK-r8b linux version
I will try again since my first answer seem to have been too subtle: You claim that you are trying to use the Linux version of the Android NDK (that is point 3 of above mail). The NDK contains - among other things - a compiler, that is an executable that reads c (c++) files and compiles them. If this executable was made for Linux (and you claim so), it will not work on Windows.
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
-- Best regards from Tom
i'm a new user of ffmpeg, please help me build a new libstagefright.so for a x86 android 4.2.2 base, i use android intel architecture r1-ia3 4.2.2 on acer w700, almost thing is ok but the video hardware accelerator. Thank u very much! -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Use-build-libstagefright-in-ffmpeg-... Sent from the FFmpeg-users mailing list archive at Nabble.com.
participants (4)
-
Carl Eugen Hoyos -
hsu tom -
likelook -
Rhodri James