环境:ubuntu16.04

交叉编译器版本:4.8.3

依赖x264,lame

x264:

1.wget ftp://ftp.videolan.org/pub/x264/snapshots/last_stable_x264.tar.bz2

2.tar xvf last_stable_x264.tar.bz2

3.cd x264-snapshot-20170903-2245-stable

4.export CC=arm-linux-gnueabi-gcc

5.export AR=arm-linux-gnueabi-ar

6.mkdir build

7.cd build

8. ../configure --enable-static --enable-shared --disable-asm --prefix=$PWD/__install --host=arm-linux-gnueabi

9.make

10.make install

lame:

1.wget https://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz

2.tar xvf lame-3.99.5.tar.gz

3.cd lame-3.99.5
4.mkdir build

5.cd build

6. ../configure --prefix=$PWD/__install --host=arm-linux-gnueabi

7.make

8.make install

ffmpeg:

1.wget www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

2. tar xvf ffmpeg-snapshot.tar.bz2

3.cd ffmpeg

4.mkdir build

5.cd build

6. ../configure --cross-prefix=/opt/x86-arm/arm-linux/bin/arm-linux-gnueabi- --disable-asm --enable-static --arch=arm --target-os=linux --prefix=$PWD/_install --disable-x86asm --enable-gpl --enable-libx264  --enable-nonfree --enable-cross-compile --extra-cflags=-I/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include --extra-ldflags=-L/home/jello/x264-snapshot-20170903-2245-stable/build/_install/lib --extra-libs=-ldl

7.进过步骤6在当前目录下有ffbuild/config.mak,那么修改此文件

文件中有以下四处需要修改

1.

CFLAGS=  -I/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -march=armv5te -std=c11 -fomit-frame-pointer -marm -pthread -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -Wno-maybe-uninitialized

2.

ASFLAGS=  -I/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -march=armv5te -g

3.

LDFLAGS= -L/home/jello/x264-snapshot-20170903-2245-stable/build/_install/lib  -march=armv5te -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample

4.EXTRALIBS=-lx264 -lm -pthread -pthread -lrt -ldl

将以上四项改动如下:

1.

CFLAGS=  -I/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -I/home/jello/lame-3.99.5/build/_install/include/lame -march=armv5te -std=c11 -fomit-frame-pointer -marm -pthread -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -Wno-maybe-uninitialized

2.

ASFLAGS=  -I/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -I/home/jello/lame-3.99.5/build/_install/include/lame -march=armv5te -g

3.

LDFLAGS= -L/home/jello/x264-snapshot-20170903-2245-stable/build/_install/lib -L/home/jello/lame-3.99.5/build/_install/lib  -march=armv5te -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample

4.EXTRALIBS=-lx264 -lm -pthread -pthread -lrt -ldl -lmp3lame

8.make

9.make install

交叉编译完成!!!

ubuntu下交叉编译ffmpeg的更多相关文章

  1. ubuntu下交叉编译lftp

    一.背景: lftp依赖于ncurses,readline和gnutls 二.准备工作 2.1交叉编译ncurses 2.1.1获取ncurses源码 wget ftp://ftp.invisible ...

  2. 在Ubuntu下编译FFmpeg

    第一步:准备编译环境 .tar.bz2 -2245/ ./configure --enable-static--enable-shared--prefix=/usr/localmakesudomake ...

  3. ubuntu下调试ffmpeg程序出现undefined reference to pthread_once ,undefined reference to uncompress错误

    Ubuntu(版本16.04)下默认配置编译Ffmpeg(版本4.1.3configure 添加选项--enable-threads),将编译好的ffmpeg库添加到程序 中进行编译出现undefin ...

  4. Xcode5和ios7下交叉编译ffmpeg

    先申明本机环境 dev-mini:ffmpeg devone$ sw_vers  ProductName:    Mac OS X ProductVersion:  BuildVersion:   1 ...

  5. ubuntu 下 编译ffmpeg 3.1.1

    1,下载ggmpeg源码:http://ffmpeg.org/download.html 2.下载ndk ,百度 3.配置环境 3.1 编译FFMPEG时,出现了 ffmpeg yasm not fo ...

  6. ubuntu下交叉编译imagemagick

    环境:ubuntu16.04 交叉编译器版本号:4.8.3 在编译之前要编译以下其依赖的软件或库:freetype,libpng,libxml2,libtiff,libjpeg,zlib,graphv ...

  7. ubuntu下编译ffmpeg+SDL+ffplay提取motion vector

    编译ffmpeg: 第一步: 从官网http://ffmpeg.org/下载最新版本. 解压tar -xjvf ffmpeg-3.3.1.tar.bz2 进入目录cd ffmpeg-3.3.1 第二步 ...

  8. ubuntu下编译ffmpeg并用eclipse调试

    一.下载ffnpeg源码 下载地址:http://ffmpeg.org/download.html 二.解决版本问题 可能之前你编译过ffmpeg,或者装过相关的库,那都要先卸载掉,否则用的时候会报一 ...

  9. ubuntu 下安装ffmpeg

    FFmpeg是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序.采用LGPL或GPL许可证.它提供了录制.转换以及流化音视 频的完整解决方案.它包含了非常先进的音频/视频编解码库 ...

随机推荐

  1. Monkey and Banana---hdu1069(dp)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069 题意就是给你n种长方体每种类型不限制个数,然后我们把它们一个个堆起来,并且要满足下面的要比上面的 ...

  2. 正则表达式(二):Unicode诸问题上篇(转)

    原文:http://www.infoq.com/cn/news/2011/02/regular-expressions-unicode 关于正则表达式的文档很多,但大部分都是英文的,即便有中文的文档, ...

  3. mysql 内置功能 事务 介绍

    事务用于将某些操作的多个SQL作为原子性操作,一旦有某一个出现错误,即可回滚到原来的状态,从而保证数据库数据完整性 创建数据库db12 create database db12 charset=utf ...

  4. python 面向对象 issubclass

    判断是否 他的父类 class Foo(object): pass obj = Foo() class Boo(Foo): pass class Coo(Boo): pass obj = Boo() ...

  5. Domino代理运行问题

    当Server出现“operation is disallowed in this session”此命令时为代理权限问题,修改后即可正常运行代理.

  6. 001-nginx基础配置-location

    一.基础语法 Location block 的基本语法形式是: location [=|~|~*|^~|@] pattern { ... } [=|~|~*|^~|@] 被称作 location mo ...

  7. vue.set的用法

    Vue.set(this.food,'count',1) //就是给this.food里面添加一个count的属性,并且赋值为1

  8. POD类型

    POD类型 POD全称Plain Old Data.通俗的讲,一个类或结构体通过二进制拷贝后还能保持其数据不变,那么它就是一个POD类型. C++11将POD划分为两个基本概念的合集,即:平凡的和标准 ...

  9. spring boot整合JWT例子

    application.properties jwt.expire_time=3600000 jwt.secret=MDk4ZjZiY2Q0NjIxZDM3M2NhZGU0ZTgzMjY34DFDSS ...

  10. 浙大 PAT 乙级 1001-1075 目录索引

    1001. 害死人不偿命的(3n+1)猜想 1002. 写出这个数 1003. 我要通过! 1004. 成绩排名 1005. 继续(3n+1)猜想 1006. 换个格式输出整数 1007. 素数对猜想 ...