ffmpeg and Android.mk

转载 2011年01月11日 16:39:00

http://oo-androidnews.blogspot.com/2010/02/ffmpeg-and-androidmk.html

 

Tuesday, February 23, 2010

ffmpeg and Android.mk

I spent several days trying to compile ffmpeg on android-ndk1.5. Just want to share to others. Hopefully, it can save you some time.

STEP1:

First, I get the source code from http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android. I will need to use its *.mk files.

STEP2:

Get the ffmpeg source code from http://ffmpeg.org/download.html. I used svn, instead of git, so that I won’t need to get libswscale separately.

STEP3:

configure my ffmpeg with following cmd.

#!/bin/sh

PREBUILT=/home/myhome/android-ndk/build/prebuilt/linux-x86/arm-eabi-4.2.1

./configure –target-os=linux /

–arch=armv41 /

–enable-cross-compile /

–cc=$PREBUILT/bin/arm-eabi-gcc /

–cross-prefix=$PREBUILT/bin/arm-eabi- /

–nm=$PREBUILT/bin/arm-eabi-nm /

–extra-cflags=”-fPIC -DANDROID ” /

–enable-static /

–disable-shared /

–disable-asm /

–disable-yasm /

–prefix=/home/myhome/work/ffmpeg-android-bin /

–extra-ldflags=”-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/home/myhome/android-ndk/build/platforms/android-1.5/arch-arm/usr/lib -L/home/myhome/android-ndk/build/platforms/android-1.5/arch-arm/usr/lib -nostdlib /home/myhome/android-ndk/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/crtbegin.o /home/myhome/android-ndk/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/crtend.o -lc -lm -ldl”

** I referenced this one at http://blog.csdn.net/anakiagmail/archive/2009/08/14/4446986.aspx ** If you don’t understand chinese, I’ll show you what it describe in following steps.

STEP4:

By now, configure should be passed successfully. Copy *.mk from olvaffe’s ffmpeg source tree to your ffmpeg-original source tree. There should be a Android.mk, av.mk under ffmpeg root dir. And, Android.mk under each libavcodec, libavutil, libavformat, libpostproc, libswscale dirs. If you don’t have Android.mk under libswscale/libpostproc, just copy one from libavutil. I don’t use libavdevice, so I just ignore it. Then, comment out all config.mak & subdir.mak in */Makefile.

STEP5:

cd to your NDK root dir, type make TARGET_ARCH=arm APP=ffmpeg-org

STEP6:

you should have a lot of compilation errors. That’s okay. I’ll show you how to fix them.

* edit libavutil/internal.h, comment out all error func(s).

* comment out all “restrict” keyword related “restrict” errors. They should in libavcodec/dsputil.h, libavformat/rtpenc_h263.c, libavcodec/dnxhdenc.c,

libavcodec/dsputil.c, libavcodec/ituh263dec.c, libavcodec/mpegvideo.c.

Try make again, and here we go. Those static *.a files are now in your NDK_ROOT/out/apps/ffmpeg-org/android-1.5-arm/.

[Via http://slworkthings.wordpress.com]

相关文章推荐

ffmpeg中android.mk

  • 2012-04-17 15:56
  • 78KB
  • 下载

Android 用NDK编译FFmpeg(生成Android.mk可以放在源代码框架内编译)

没有eoe的账号,级别还太低,出门如何吹牛逼? 您需要 登录 才可以下载或查看,没有帐号?免费加入  x Android内置的编解码器实在太少,于是我们需要FFmpeg。Android提...

Android.mk生成工具

  • 2013-01-30 20:10
  • 18KB
  • 下载

Android.mk 规范详解

  • 2011-01-28 10:00
  • 544KB
  • 下载

Android.mk简介

转载:http://blog.csdn.net/hudashi/article/details/7059006 文章参照:http://blog.sina.com.cn/s/blog_67d8d...

Android.mk

生成android.mk文件

  • 2015-10-09 11:00
  • 19KB
  • 下载

android.mk 避免手动加入.h/.cpp

LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos2dcpp_shared ...
  • lmxdy
  • lmxdy
  • 2014-05-21 10:38
  • 575
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)