码迷,mamicode.com
首页 > 其他好文 > 详细

ffmpeg编译x264, 这个libffmpeg即可解码又可以h264编码

时间:2014-11-08 19:26:46      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   io   ar   os   sp   for   

 
http://blog.csdn.net/u012917616/article/details/40921861
不废话,直接上.sh脚本:

export NDK=/home/xxx/my_software/android-ndk-r10

export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt

export PLATFORM=$NDK/platforms/android-14/arch-arm

export PREFIX=/home/xxx/x264


build_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/xxx/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/xxx/x264/lib"


#make clean

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 /home/xxx/x264/lib/libx264.a -lc -lm -lz -ldl -llog --dynamic-linker=/system/bin/linker $PREBUILT/linux-x86/lib/gcc/arm-linux-androideabi/4.8/libgcc.a

}


build_one

ffmpeg编译x264, 这个libffmpeg即可解码又可以h264编码

标签:android   style   blog   http   io   ar   os   sp   for   

原文地址:http://www.cnblogs.com/runner42/p/4083782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!