Android compilation ffmpeg + x264

Source: Internet
Author: User

Compile x264:
Download the latest version x264
Ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
1. decompress the package to the specified directory.
2. Switch the current directory to this directory
3. Create a shell script build_x264.sh with the following content:

Export NDK =/home/robin/desktop/android-ndk-r8cexport PREBUILT = $ NDK/toolchains/arm-linux-androideabi-4.4.3/prebuiltexport PLATFORM = $ NDK/platforms/android-8/arch-arm export PREFIX =/home /robin/android-x264. /configure -- prefix = $ PREFIX \ -- enable-static \ -- enable-pic \ -- disable-asm \ -- disable-cli \ -- host = arm-linux \ -- cross-prefix = $ PREBUILT/linux-x86/bin/arm-linux-androideabi-\ -- sysroot = $ PLATFORM

Execute the following command to compile and install
Make
Sudo make install
Sudo ldconfig
Compile ffmpeg:
Download the latest ffmpeg
Http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
1. decompress the package to the specified directory.
2. Switch the current directory to this directory
3. Create a shell script build_ffmpeg.sh with the following content:

#!/bin/shexport PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuiltexport PLATFORM=$NDK/platforms/android-8/arch-armexport PREFIX=/home/robin/android-x264build_one(){./configure --target-os=linux --prefix=$PREFIX \--enable-cross-compile \--enable-runtime-cpudetect \--disable-asm \--arch=arm \--cc=$PREBUILT/linux-x86/bin/arm-linux-androideabi-gcc \--cross-prefix=$PREBUILT/linux-x86/bin/arm-linux-androideabi- \--disable-stripping \--nm=$PREBUILT/linux-x86/bin/arm-linux-androideabi-nm \--sysroot=$PLATFORM \--enable-nonfree \--enable-version3 \--disable-everything \--enable-gpl \--disable-doc \--enable-avresample \--enable-demuxer=rtsp \--enable-muxer=rtsp \--disable-ffplay \--disable-ffserver \--enable-ffmpeg \--disable-ffprobe \--enable-libx264 \--enable-encoder=libx264 \--enable-decoder=h264 \--enable-protocol=rtp \--enable-hwaccels \--enable-zlib \--disable-devices \--disable-avdevice \--extra-cflags="-I/home/robin/android-x264/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \--extra-ldflags="-L/home/robin/android-x264/lib"make -j4 install$PREBUILT/linux-x86/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o$PREBUILT/linux-x86/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a}build_one

Execute build_ffmpeg.sh to compile and output the file to the directory specified by $ PREFIX.

Original article: http://hi.baidu.com/duizhe_memory/item/482e6fd6ccfee7fa93a974be

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.