FFmpeg在Android上的移植优化步骤
http://blog.csdn.net/feixiang_john/article/details/7894188
从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmpeg开发的。如今最火的智能手机操作系统Android上的很多第三方视频播放器也是基于FFmpeg实现全格式支持。由于Android通常跑在ARM处理器上,而且Android使用了自己的libc库(即bionic),因此要在Android上编译和使用FFmpeg需要做一些移植工作,好在FFmpeg本身用C写成,很好地支持跨平台移植,实现这个目的并不难,事实上已经有很多前辈做过这方面的工作并公开了他们的成果。
1. Rockplayer:
http://rockplayer.freecoder.org/index_cn.html
http://blog.csdn.net/harry_helei/article/details/6322767
2. havlenapetr:
http://github.com/havlenapetr/FFMpeg
http://blog.csdn.net/scut1135/article/details/6536157
http://hi.baidu.com/eefolks/blog/item/e0329e4682859129cefca351.html
http://ajavn.com/anzhuotuandui/4351.html
3. halfninja:
https://github.com/halfninja/android-ffmpeg-x264
4. olvaffe's:
http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
http://www.nujk.com/ffmpeg-on-android
5. 流媒体开发论坛 - 罗索工作室:
http://www.rosoo.net/a/201108/14834.html
http://bbs.rosoo.net/thread-6252-1-1.html
当下本人也做这方面的事情,主要是优化ffmpeg编解码的性能,当然首先就是要搭建环境,编译代码,测试代码性能,然后优化模块,编译测试和调试,最终再测试性能:看了很多文章,对于一些新手是有点帮助,但是都不是很全面,下面简单记录下我如何搭建环境,如何编译,测试:
可以使用Rockplayer的方案进行实践。Rockplayer是Android上最有名的第三方视频播放器之一,其开发者根据LGPL协议公开了所使用的FFmpeg源码,该方案用Android NDK将FFmpeg源码编译生成一个单独的共享库libffmpeg.so,其中静态链接了libavformat、libavcodec、libavutil等模块,要使用FFmpeg只需要调用这一个.so即可。当然有了这个库还只是第一步,要利用FFmpeg开发一个自己的播放器或者把FFmpeg集成到Android本身的播放引擎stagefright中还需要很多其他工作,包括针对硬件平台进行优化。目前我做的只是编译出libffmpeg.so以及将FFmpeg自带的工具ffmpeg在adb shell中跑起来。我是在Android 3.2(Honeycomb)上编译FFmpeg,所用NDK版本为r7,在Android的其他版本上编译也大同小异。
题外话:Rockplayer之前也和他们谈过合作的事情,一家几个人搞得小型公司(其实也谈不上公司了),office在上海张江一个不起眼的小区里,也不能说他们没有技术含量,只能说他们找到一个突破口,能挣点小钱,他们的android手机播放器设计原则是支持要全,画质要清晰,性能不是主要,面向中高档手机,配置相对来说就高些。
下面把具体编译步骤描述如下,假定NDK安装在~/android-ndk-r7:
1. 首先从FFmpeg官网下载最新的release版本源码ffmpeg-0.11.tar.gz解压缩到Android源码树的ffmpeg/下。
2 准备一个编译脚本build_android.sh并放在ffmpeg/下面,这个脚本也是Rockplayer提供的,需做一些修改,其内容附在后面。我目前用的也会附在后面。
3 在ffmpeg目录下运行./build_android.sh开始编译FFmpeg,编译好的libffmpeg.so会放在文件夹android里面,一共有3个版本分别对应3种ARM体系结构,包括armv7-a、armv7-a-vfp、armv6_vfp,根据所运行的硬件平台选取其中一个版本。为了编译使用FFmpeg的程序时可以方便地找到libffmpeg.so,可将它复制到$OUT/system/lib/和$OUT/obj/lib/,当然这一步也可以加在build_android.sh中做。
4. 接下来就是编译可执行文件ffmpeg了,这个工具可以在命令行下完成FFmpeg提供的几乎所有功能包括编码、解码、转码等,也是用来调试和验证很有用的工具。其实上述编译完后在$ANDROID_BUILD_TOP/external/ffmpeg/下也会生成ffmpeg,但是在设备上无法运行。为了编出能在设备上运行的ffmpeg,可以写一个简单的Android.mk,其内容如下:
- LOCAL_PATH:= $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_SRC_FILES:= \
- cmdutils.c \
- ffmpeg.c
- LOCAL_C_INCLUDES :=
- LOCAL_SHARED_LIBRARIES := \
- libffmpeg
- LOCAL_PRELINK_MODULE := false
- LOCAL_MODULE := ffmpeg
- include $(BUILD_EXECUTABLE)
也可以在E:\android-ndk-r7-windows\android-ndk-r7\samples\test-libstdc++\jni这个目录修改下Android.mk, 修改为:
- LOCAL_PATH:= $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_SRC_FILES := ffmpeg.c cmdutils.c
- #LOCAL_PREBUILT_LIBS := libffmpeg
- LOCAL_ARM_MODE := arm
- LOCAL_C_INCLUDES += \
- $(LOCAL_PATH)/include \
- $(LOCAL_PATH)/include/libavcodec \
- $(LOCAL_PATH)/ \
- $(LOCAL_PATH)/include/libavfilter \
- $(LOCAL_PATH)/include/libavdevice \
- $(LOCAL_PATH)/include/libavutil
- #LOCAL_LDLIBS := -L$(LOCAL_PATH) -lffmpeg
- LOCAL_LDLIBS := libffmpeg.so
- LOCAL_MODULE := ffmpeg
- include $(BUILD_EXECUTABLE)
当然要把ffmpeg.c cmdutils.c和libffmpeg.so拷贝到当前目录。
5. 将上面编好的libffmpeg.so和ffmpeg分别用adb push复制到设备的/system/lib/和/system/bin/,push之前可先对libffmpeg.so做一下strip否则太大。现在就可以在adb shell中运行ffmpeg了,使用方法与在PC上相同。当然如果要用到其他开源库例如x264那么还需要把它们也移植到Android。
以上是基本的步骤,仅供参考,可以根据具体情况修改build_android.sh里面的配置选项。如前所述,编译FFmpeg只是第一步,后续还有很多工作需要做,今后如果有进展再贴上来。
最后附上build_android.sh供参考,在此也感谢Rockplayer的开发者:
- #!/bin/bash
- ######################################################
- # FFmpeg builds script for Android+ARM platform
- #
- # This script is released under term of
- # CDDL (http://www.opensource.org/licenses/cddl1)
- # Wrote by pinxue (~@gmail.com) from RockPlayer.com
- # 2010-8 ~ 2011-4
- ######################################################
- ######################################################
- # Usage:
- # put this script in top of FFmpeg source tree
- # ./build_android
- #
- # It generates binary for following architectures:
- # ARMv6
- # ARMv6+VFP
- # ARMv7+VFPv3-d16 (Tegra2)
- # ARMv7+Neon (Cortex-A8)
- #
- # Customizing:
- # 1. Feel free to change ./configure parameters for more features
- # 2. To adapt other ARM variants
- # set $CPU and $OPTIMIZE_CFLAGS
- # call build_one
- ######################################################
- NDK=~/android-ndk-r7
- PLATFORM=$NDK/platforms/android-8/arch-arm/
- PREBUILT=../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3
- function build_one
- {
- # -fasm : required. Android header file uses asm keyword instead of __asm__ , but most of c dialect (like ansi,c99,gnu99) implies -fno-asm.
- # ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h: In function '___arch__swab32':
- # ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h:25: error: expected ')' before ':' token
- # -fno-short-enums : optimized. Else FFmpeg obj will generate a huge number of warning for variable-size enums,
- # though we may suppress them by --no-enum-size-warning, it would be better to avoid it.
- # .../ld: warning: cmdutils.o uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
- # --extra-libs="-lgcc" : required. Else cannot solve some runtime function symbols
- # ... undefined reference to `__aeabi_f2uiz'
- # --enable-protocols : required. Without this option, the file open always fails mysteriously.
- # FFmpeg's av_open_input_file will invoke file format probing functions, but because most of useful demuxers has flag of zero
- # which cause them are ignored during file format probling and fall to url stream parsing,
- # if protocols are disabled, the file:// url cannot be opened as well.
- # $PREBUILT/bin/arm-eabi-ar d libavcodec/libavcodec.a inverse.o : required.
- # FFmpeg includes two copies of inverse.c both in libavutil and libavcodec for performance consideration (not sure the benifit yet)
- # Without this step, final ld of generating libffmpeg.so will fail silently, if invoke ld through gcc, gcc will collect more reasonable error message.
- # -llog: debug only, FFmpeg itself doesn't require it at all.
- # With this option, we may simply includes "utils/Log.h" and use LOGx() to observe FFmpeg's behavior
- # PS, it seems the toolchain implies -DNDEBUG somewhere, it would be safer to use following syntax
- # #ifdef NDEBUG
- # #undef NDEBUG
- # #define HAVE_NDEBUG
- # #endif
- # #include "utils/Log.h"
- # #ifdef HAVE_NDEBUG
- # #define NDEBUG
- # #undef HAVE_NDEBUG
- # #endif
- # --whole-archive : required. Else ld generate a small .so file (about 15k)
- # --no-stdlib : required. Android doesn't use standard c runtime but invited its own wheal (bionic libc) because of license consideration.
- # space before \ of configure lines: required for some options. Else next line will be merged into previous lines's content and cause problem.
- # Especially the --extra-cflags, the next line will pass to gcc in this case and configure will say gcc cannot create executable.
- # many options mentioned by articles over internet are implied by -O2 or -O3 already, need not repeat at all.
- # two or three common optimization cflags are omitted because not sure about the trade off yet. invoke NDK build system with V=1 to find them.
- # -Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x mentioned by almost every articles over internet, but it is not required to specify at all.
- # -Dipv6mr_interface=ipv6mr_ifindex : required. Android inet header doesn't use ipv6mr_interface which is required by rfc, seems it generate this user space header file directly from kernel header file, but Linux kernel has decided to keep its own name for ever and ask user space header to use rfc name.
- # HAVE_SYS_UIO_H : required. Else:
- # In file included from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/socket.h:29,
- # from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/sys/socket.h:33,
- # from libavformat/network.h:35,
- # from libavformat/utils.c:46:
- #~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/uio.h:19: error: redefinition of 'struct iovec'
- #
- # --disable-doc : required because of strange bug of toolchain.
- ./configure --target-os=linux \
- --prefix=$PREFIX \
- --enable-cross-compile \
- --extra-libs="-lgcc" \
- --arch=arm \
- --cc=$PREBUILT/bin/arm-eabi-gcc \
- --cross-prefix=$PREBUILT/bin/arm-eabi- \
- --nm=$PREBUILT/bin/arm-eabi-nm \
- --sysroot=$PLATFORM \
- --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
- --disable-shared \
- --enable-static \
- --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \
- --enable-parsers \
- --enable-encoders \
- --enable-decoders \
- --enable-muxers \
- --enable-demuxers \
- --enable-swscale \
- --enable-swscale-alpha \
- --disable-ffplay \
- --disable-ffprobe \
- --disable-ffserver \
- --enable-network \
- --enable-indevs \
- --disable-bsfs \
- --enable-filters \
- --enable-avfilter \
- --enable-protocols \
- --enable-asm \
- $ADDITIONAL_CONFIGURE_FLAG
- #make clean
- make -j4 install
- $PREBUILT/bin/arm-eabi-ar d libavcodec/libavcodec.a inverse.o
- $PREBUILT/bin/arm-eabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libavfilter/libavfilter.a libswscale/libswscale.a libavdevice/libavdevice.a libswresample/libswresample.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-eabi/4.4.3/libgcc.a
- }
- #arm v6
- CPU=armv6
- OPTIMIZE_CFLAGS="-marm -march=$CPU"
- PREFIX=./android/$CPU
- ADDITIONAL_CONFIGURE_FLAG=
- #build_one
- #arm v7vfpv3
- CPU=armv7-a
- OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
- PREFIX=./android/$CPU
- ADDITIONAL_CONFIGURE_FLAG=
- build_one
- #arm v7vfp
- CPU=armv7-a
- OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "
- PREFIX=./android/$CPU-vfp
- ADDITIONAL_CONFIGURE_FLAG=
- build_one
- #arm v7n
- CPU=armv7-a
- OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8"
- PREFIX=./android/$CPU
- ADDITIONAL_CONFIGURE_FLAG=--enable-neon
- build_one
- #arm v6+vfp
- CPU=armv6
- OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU"
- PREFIX=./android/${CPU}_vfp
- ADDITIONAL_CONFIGURE_FLAG=
- build_one
下面是我使用的 build_android.sh文件:
- #!/bin/bash
- ######################################################
- # FFmpeg builds script for Android+ARM platform
- #
- # This script is released under term of
- # CDDL (http://www.opensource.org/licenses/cddl1)
- ######################################################
- # Usage:
- # put this script in top of FFmpeg source tree
- # ./build_android
- #
- # It generates binary for following architectures:
- # ARMv6
- # ARMv6+VFP
- # ARMv7+VFPv3-d16 (Tegra2)
- # ARMv7+Neon (Cortex-A8)
- #
- # Customizing:
- # 1. Feel free to change ./configure parameters for more features
- # 2. To adapt other ARM variants
- # set $CPU and $OPTIMIZE_CFLAGS
- # call build_one
- ######################################################
- NDK=E:/android-ndk-r7-windows/android-ndk-r7
- PLATFORM=$NDK/platforms/android-8/arch-arm/
- PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows
- function build_one
- {
- # -fasm : required. Android header file uses asm keyword instead of __asm__ , but most of c dialect (like ansi,c99,gnu99) implies -fno-asm.
- # ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h: In function '___arch__swab32':
- # ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/asm/byteorder.h:25: error: expected ')' before ':' token
- # -fno-short-enums : optimized. Else FFmpeg obj will generate a huge number of warning for variable-size enums,
- # though we may suppress them by --no-enum-size-warning, it would be better to avoid it.
- # .../ld: warning: cmdutils.o uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
- # --extra-libs="-lgcc" : required. Else cannot solve some runtime function symbols
- # ... undefined reference to `__aeabi_f2uiz'
- # --enable-protocols : required. Without this option, the file open always fails mysteriously.
- # FFmpeg's av_open_input_file will invoke file format probing functions, but because most of useful demuxers has flag of zero
- # which cause them are ignored during file format probling and fall to url stream parsing,
- # if protocols are disabled, the file:// url cannot be opened as well.
- # $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o : required.
- # FFmpeg includes two copies of inverse.c both in libavutil and libavcodec for performance consideration (not sure the benifit yet)
- # Without this step, final ld of generating libffmpeg.so will fail silently, if invoke ld through gcc, gcc will collect more reasonable error message.
- # -llog: debug only, FFmpeg itself doesn't require it at all.
- # With this option, we may simply includes "utils/Log.h" and use LOGx() to observe FFmpeg's behavior
- # PS, it seems the toolchain implies -DNDEBUG somewhere, it would be safer to use following syntax
- # #ifdef NDEBUG
- # #undef NDEBUG
- # #define HAVE_NDEBUG
- # #endif
- # #include "utils/Log.h"
- # #ifdef HAVE_NDEBUG
- # #define NDEBUG
- # #undef HAVE_NDEBUG
- # #endif
- # --whole-archive : required. Else ld generate a small .so file (about 15k)
- # --no-stdlib : required. Android doesn't use standard c runtime but invited its own wheal (bionic libc) because of license consideration.
- # space before \ of configure lines: required for some options. Else next line will be merged into previous lines's content and cause problem.
- # Especially the --extra-cflags, the next line will pass to gcc in this case and configure will say gcc cannot create executable.
- # many options mentioned by articles over internet are implied by -O2 or -O3 already, need not repeat at all.
- # two or three common optimization cflags are omitted because not sure about the trade off yet. invoke NDK build system with V=1 to find them.
- # -Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x mentioned by almost every articles over internet, but it is not required to specify at all.
- # -Dipv6mr_interface=ipv6mr_ifindex : required. Android inet header doesn't use ipv6mr_interface which is required by rfc, seems it generate this user space header file directly from kernel header file, but Linux kernel has decided to keep its own name for ever and ask user space header to use rfc name.
- # HAVE_SYS_UIO_H : required. Else:
- # In file included from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/socket.h:29,
- # from ~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/sys/socket.h:33,
- # from libavformat/network.h:35,
- # from libavformat/utils.c:46:
- #~/android/android-ndk-r4/build/platforms/android-5/arch-arm//usr/include/linux/uio.h:19: error: redefinition of 'struct iovec'
- #
- # --disable-doc : required because of strange bug of toolchain.
- ./configure --target-os=linux \
- --prefix=$PREFIX \
- --enable-cross-compile \
- --extra-libs="-lgcc" \
- --arch=arm \
- --enable-memalign-hack \
- --enable-gpl \
- --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
- --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
- --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
- --sysroot=$PLATFORM \
- --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
- --disable-shared \
- --enable-static \
- --extra-ldflags="-Wl,-T,$PREBUILT/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtbegin.o $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtend.o -L$PLATFORM/usr/lib -lc -lm -ldl -llog" \
- --enable-parsers \
- --enable-decoders \
- --enable-swscale \
- --disable-ffplay \
- --disable-ffprobe \
- --disable-ffserver \
- --enable-network \
- --enable-indevs \
- --enable-optimizations \
- --enable-asm \
- --enable-swresample \
- --disable-debug
- $ADDITIONAL_CONFIGURE_FLAG
- #make clean
- make -j4 install
- $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
- $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libavfilter/libavfilter.a libswscale/libswscale.a libswresample/libswresample.a libavresample/libavresample.a libpostproc/libpostproc.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
- }
- ##arm v6
- #CPU=armv6
- #OPTIMIZE_CFLAGS="-marm -march=$CPU"
- #PREFIX=./android/$CPU
- #ADDITIONAL_CONFIGURE_FLAG=
- ##build_one
- #
- ##arm v7vfpv3
- #CPU=armv7-a
- #OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
- #PREFIX=./android/$CPU
- #ADDITIONAL_CONFIGURE_FLAG=
- #build_one
- #
- ##arm v7vfp
- #CPU=armv7-a
- #OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "
- #PREFIX=./android/$CPU-vfp
- #ADDITIONAL_CONFIGURE_FLAG=
- #build_one
- #arm v7n
- CPU=armv7-a
- OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8"
- PREFIX=./android/$CPU
- ADDITIONAL_CONFIGURE_FLAG=--enable-neon
- build_one
- ##arm v6+vfp
- #CPU=armv6
- #OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU"
- #PREFIX=./android/${CPU}_vfp
- #ADDITIONAL_CONFIGURE_FLAG=
- #build_one
6. 把编译好的libffmpeg.so 和 可执行文件 ffmpeg 文件push到 手机里面运行测试! 下面是操作步骤:
a: 拷贝文件到手机sdcard
E:\android-ndk-r7-windows\android-ndk-r7\samples\test-libstdc++\libs\armeabi>
拷贝可执行文件
adb push ffmpeg /sdcard/ttt
4507 KB/s (144248 bytes in 0.031s)
拷贝库
adb push liffmpeg.so /sdcard/ttt
3756 KB/s (8233079 bytes in 2.140s)
b: 从手机sdcard 拷贝到系统bin目录和系统lib目录
E:\android-ndk-r7-windows\android-ndk-r7\samples\test-libstdc++\libs\armeabi>adb
shell
$ su
su
# cd /system/bin
cd /system/bin
# rm ffmpeg
rm ffmpeg
# cat /sdcard/ttt/ffmpeg > ffmpeg
cat /sdcard/ttt/ffmpeg > ffmpeg
# chmod 777 ffmpeg
chmod 777 ffmpeg
# cd ../lib
cd /system/lib
# rm libffmpeg.so
rm libffmpeg.so
# cat /sdcard/ttt/libffmpeg.so >libffmpeg.so
cat /sdcard/ttt/libffmpeg.so >libffmpeg.so
# chmod 777 libffmpeg.so
chmod 777 libffmpeg.so
# cd ../bin
cd /system/bin
运行可执行文件:
./ffmpeg -i /sdcard/ttt/test.264 /sdcard/ttt/output.yuv
FFmpeg在Android上的移植优化步骤的更多相关文章
- FFmpeg在Android上的移植之第一步
http://blog.sina.com.cn/s/blog_69a04cf40100x1fr.html 从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmpeg开发的. ...
- android开发中图片优化步骤
android开发中图片优化方法 1.图片加载方法,方便用户加载图片 /*** * 加载本地图片 * @param context:主运行函数实例 * @param bitAdress:图片地址,一般 ...
- ffmpeg在android上输出滑屏问题处理
ffmpeg部分机器上有花屏的问题 原代码例如以下: while(av_read_frame(formatCtx, &packet)>=0 && !_stop & ...
- ffmpeg在am335x上的移植
交叉编译工具:arm-linux-gcc 一.先下载一下文件 1. yasm-1.2.0.tar.gz 2. x264-snapshot-20140424-2245.tar.bz2 3. xvidco ...
- FFmpeg的Android平台移植—编译篇
摘要:本文主要介绍将FFmpeg音视频编解码库移植到Android平台上的编译和基本测试过程. 环境准备: ubuntu-12.04.5 android-ndk64-r10-linux-x86_64. ...
- Ionic在Android上部署app步骤
详情链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/ionic%E5%9C%A8android%E4%B8%8A%E9%83% ...
- STemWin5.22在STM32F103上的移植步骤
源:STemWin5.22在STM32F103上的移植步骤
- clapack在android上移植
参考 https://www.cnblogs.com/hrlnw/p/4128217.html 如何在android上进行android库编译 https://blog.csdn.net/h3c4le ...
- 系列篇|编译可在Android上运行的依赖库(一):glib库
前言 这是系列文章,它们由<编译可在Android上运行的glib库>及其他4篇文章组成,这4篇文章在“编译依赖库”一节中列出.由于glib库依赖于其他第三方库,所以需要先将依赖的第三方库 ...
随机推荐
- mysql 再查询结果的基础上查询(子查询)
SELECT A.wx_name, A.wx_litpic, B . * FROM ( SELECT uid, COUNT( * ) AS daticishu FROM statements , ) ...
- Yii2 mongodb 扩展的where的条件加入大于小于号浅析(转)
1. mongodb的where中有比较丰富的 条件,如下: static $builders = [ 'NOT' => 'buildNotCondition', 'AND' => 'bu ...
- ps液化
ps液化画笔工具属性 画笔大小:顾名思义画笔大小.液化处理范围 画笔密度:推动画笔时扭曲效果范围.以圆心为出发点,随密度增大扭曲影响范围越大(圆半径大小),达到最大值时圆圈内像素都会发生扭曲.好比真实 ...
- JS动态增加删除UL节点LI
JS如何动态增加删除UL节点LI及相关内容. <ul id="ul"> <li id=1>11111111111111111<a href=" ...
- [学习笔记]Spring依赖注入
依赖: 典型的企业应用程序不可能由单个对象(在spring中,也可称之bean)组成,再简单的应用也是由几个对象相互配合工作的,这一章主要介绍bean的定义以及bean之间的相互协作. 依赖注入: s ...
- SQL server插入数据后,如何获取自增长字段的值?
insert into Tb_People(uname,era,amount) values( '兆周','老年','10000') select @@identity --当运行完插入语句后,执行s ...
- jquery+asp.net 调用百度geocoder手机浏览器定位--Api介绍及Html定位方法
原文来自:***/projecteactual/jqueryaspnetbaidugeocodermobilebrowserposition.html 在做一个社区项目中,支持移动浏览器进行选择地区和 ...
- cocos2d-xV3.0rc 环境搭建
一.下载 由于www.cocos2d-x.org很难打开,不知道是不是电信的问题,所以只好在cocoschina论坛里王哲大牛的帖子里找到了一个下载链接:http://126.am/GyU7l0 帖子 ...
- 如何創建一個自己的 Composer/Packagist 包 (PHP)
如何創建一個自己的 Composer/Packagist 包 首先讓我們踏着歡快的腳步去Github創建一個新庫,這裏取名 composer-car,又歡快的將它克隆到本地: git clone ht ...
- Django——model基础
ORM 映射关系: 表名 <-------> 类名 字段 <-------> 属性 表记录 <------->类实例对象 创建表(建立模型) 实例:我们来假定下 ...