开发者

Android Cross-compiling ffmpeg

开发者 https://www.devze.com 2023-03-04 23:16 出处:网络
Is there any option to compile FFMPEG under the ARM (Android NDK) dynamically? (I found only articles about static compiling)

Is there any option to compile FFMPEG under the ARM (Android NDK) dynamically? (I found only articles about static compiling) And the second question: when build开发者_JS百科ing FFMPEG I can not find files Makefile.am. Can they somehow get it?


I chose this toolchain for the more commonly used 4.4.0 of gcc when compiling as most arm linux products use it you can change for your liking, I don't know if it will work with substitutions so please don't ask. I ran the ./configure command hundreds of times before I got a succssful build. Therefore I am sharing what worked maybe it will help you.

Using UBUNTU 32-bit 10.04.03 in VirtuaBox Guest / Host machine is Vista 64

Change <USERNAME> to your linux users name

mkdir /home/<USERNAME>/applications
cd /home/<USERNAME>/applications
wget http://dl.google.com/android/ndk/android-ndk-r5b-linux-x86.tar.bz2
wget http://ffmpeg.org/releases/ffmpeg-0.8.7.tar.bz2
tar -xjf android-ndk-r5b-linux-x86.tar.bz2
tar -xjf ffmpeg-0.8.7.tar.bz2
mv ffmpeg-0.8.7 ffmpeg

NDK=/home/<USERNAME>/applications/android-ndk-r5b
$NDK/build/tools/make-standalone-toolchain.sh --platform=android-8 --toolchain=arm-eabi-4.4.0 --install-dir=/home/<USERNAME>/applications/droidtooleabi

cd ffmpeg
export PATH=/home/<USERNAME>/applications/droidtooleabi/bin:$PATH
export CC=arm-linux-androideabi-gcc
./configure \
--target-os=linux \
--cross-prefix=arm-eabi- \
--arch=arm \
--enable-small \
--disable-armvfp \
--prefix=../build/ffmpeg \
--disable-encoders \
--disable-decoders \
--disable-protocols \
--disable-muxers \
--disable-demuxers \
--disable-parsers \
--disable-devices \
--enable-decoder=mp3 \
--enable-decoder=vorbis \
--enable-decoder=alac \
--enable-decoder=mpeg4 \
--enable-decoder=vp8 \
--enable-decoder=flac \
--enable-decoder=pcm_s8 \
--enable-decoder=pcm_u8 \
--enable-decoder=h264 \
--enable-decoder=h263 \
--enable-encoder=adpcm_swf \
--enable-decoder=adpcm_swf \
--enable-encoder=nellymoser \
--enable-decoder=nellymoser \
--enable-encoder=flv \
--enable-decoder=flv \
--enable-encoder=aac \
--enable-decoder=aac \
--enable-decoder=amrnb \
--enable-decoder=amrwb \
--enable-encoder=pcm_s16le \
--enable-decoder=pcm_s16le \
--enable-muxer=amr \
--enable-demuxer=amr \
--enable-muxer=flv \
--enable-demuxer=flv \
--enable-muxer=pcm_s16le \
--enable-demuxer=pcm_s16le \
--enable-muxer=wav \
--enable-demuxer=wav \
--enable-muxer=matroska \
--enable-demuxer=matroska \
--enable-muxer=matroska_audio \
--enable-demuxer=matroska_audio \
--enable-muxer=m4v \
--enable-demuxer=m4v \
--enable-muxer=mov \
--enable-demuxer=mov \
--enable-muxer=h263 \
--enable-demuxer=h263 \
--enable-muxer=h264 \
--enable-demuxer=h264 \
--enable-muxer=webm \
--enable-demuxer=webm \
--enable-muxer=ogg \
--enable-demuxer=ogg \
--enable-muxer=flac \
--enable-demuxer=flac \
--enable-muxer=mpegts \
--enable-demuxer=mpegts \
--enable-muxer=mpegtsraw \
--enable-demuxer=mpegtsraw \
--enable-muxer=aac \
--enable-demuxer=aac \
--enable-parser=aac \
--enable-parser=h263 \
--enable-parser=h264 \
--enable-parser=vp8 \
--enable-parser=mpegvideo \
--enable-parser=mpegaudio \
--enable-parser=mpeg4video \
--enable-parser=flac \
--enable-protocol=rtmps \
--enable-protocol=rtmpt \
--enable-protocol=crypto \
--enable-protocol=rtmpte \
--enable-protocol=file \
--enable-protocol=pipe \
--enable-protocol=rtp \
--enable-protocol=rtmp \
--enable-protocol=tcp \
--enable-protocol=http \
--enable-protocol=rtmpe \
--enable-protocol=udp \
--disable-ffprobe \
--disable-ffserver \
--extra-cflags='-I/home/<USERNAME>/applications/droidtooleabi/sysroot/usr/include -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -march=armv5te -mtune=xscale -msoft-float' \
--extra-ldflags='-nostdlib /home/<USERNAME>/applications/droidtooleabi/sysroot/usr/lib/libc.so /home/<USERNAME>/applications/droidtooleabi/sysroot/usr/lib/libm.so -Wl,-rpath-link=/home/<USERNAME>/applications/droidtooleabi/sysroot/usr/lib -L/home/<USERNAME>/applications/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/lib/gcc/arm-eabi/4.4.0' \
--extra-ldflags='-Wl,-dynamic-linker,/system/bin/linker /home/<USERNAME>/applications/droidtooleabi/sysroot/usr/lib/crtbegin_dynamic.o /home/<USERNAME>/applications/droidtooleabi/sysroot/usr/lib/crtend_android.o' \
--extra-libs=-lgcc
0

精彩评论

暂无评论...
验证码 换一张
取 消