1 获取源代码

git clone -b "branch" https://git.ffmpeg.org/ffmpeg.git

“branch” 可以是以下的masterrelease/3.1等等,具体看需要使用哪个分支。

5 hours ago master shortlog | log | tree
4 days ago release/3.1 shortlog | log | tree
4 days ago release/3.2 shortlog | log | tree
4 days ago release/3.3 shortlog | log | tree
3 weeks ago release/3.0 shortlog | log | tree
2 months ago release/2.8 shortlog | log | tree
12 months ago release/2.7 shortlog | log | tree
12 months ago release/2.6 shortlog | log | tree
12 months ago release/2.5 shortlog | log | tree

2 Configure配置

在源码的目录下调用configure脚本,通过 -h 查看相应的帮助,这里写了一个简单的脚本build-ffmpeg.sh;

#!/bin/bash

PREFIX=out
TOOLCHAINS=/mnt/diska/X3399/source/buildroot/output/host/opt/ext-toolchain/bin
CROSS_COMPILE=${TOOLCHAINS}/aarch64-linux-gnu-
LOCAL_PATH=`pwd`
CFLAGS="-Wall -pipe -fpic \
-finline-limit=300 -ffast-math \
-fstrict-aliasing -Werror=strict-aliasing \
-fmodulo-sched -fmodulo-sched-allow-regmoves \
-Wno-psabi -Wa,--noexecstack"
EXTRA_CFLAGS=
EXTRA_LDFLAGS=
CPU_NAME=cortex-a72
FFMPEG_FLAGS="--prefix=${PREFIX} \
--target-os=linux \
--arch=arm \
--cpu=$CPU_NAME \
--enable-cross-compile \
--cross-prefix=${CROSS_COMPILE} \
--enable-shared \
--disable-symver \
--disable-doc \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-avfilter \
--disable-muxers \
--disable-filters \
--disable-devices \
--disable-everything \
--enable-protocols \
--enable-parsers \
--enable-demuxers \
--disable-demuxer=sbg \
--enable-decoders \
--enable-bsfs \
--enable-network \
--enable-swscale \
--enable-neon \
--enable-version3 \
--disable-yasm \
--disable-asm" #--enable-debug \
#--disable-stripping \
#--disable-optimizations \ ./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$LDFLAGS $EXTRA_LDFLAGS" #make && make install

3 报错处理

如果在根目录下直接执行build-ffmpeg.sh脚本是无法成功安装ffmpeg的,首先这里会出现以下几个问题。

报错1:

错误内容:

{your path to toolchians}/aarch64-linux-gnu-gcc is unable to create an executable file. C compiler test failed.

解决方案:

  1. 打开configure文件;

  2. 搜索报错内容“C compiler test failed”,定位到以下内容,注释掉 die “C compiler test failed.” 或者修改 if 条件使得条件一直成立也是可以的。

    if test "$?" != 0; then
    echo "$cc is unable to create an executable file."
    if test -z "$cross_prefix" && ! enabled cross_compile ; then
    echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
    echo "Only do this if you know what cross compiling means."
    fi # die "C compiler test failed." fi

报错2

错误内容:

If you think configure made a mistake, make sure you are using the latest

version from Git. If the latest version fails, report the problem to the

ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.

Include the log file “config.log” produced by configure as this will help

solve the problem.

解决方案:

和报错1的解决方案类似,需要定位configure文件中的错误信息提示内容,

 die(){
echolog "$@"
cat <<EOF If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
EOF
if disabled logging; then
cat <<EOF
Rerun configure with logging enabled (do not use --disable-logging), and
include the log this produces with your report.
EOF
else
cat <<EOF
Include the log file "$logfile" produced by configure as this will help
solve the problem.
EOF
fi
# exit 1
}

简单粗暴一点将exit 1直接注释掉,这样就不会退出了,但是会遇到什么问题不得而知,至少目前可以成功安装了。

报错3

错误内容:

aarch64-linux-gnu-gcc: error: missing argument to ‘-mcpu=’

解决方案:

configure 参数中加入 –cpu=$CPU_NAME 选项

4 At last

最后将out文件夹下的 文件copy到目标板上即可

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

  1. Linux下ffmpeg安装与开发配置

    Linux下ffmpeg安装与开发配置   1. ffmpeg安装 安装环境: ubuntu 12.04 (1)删除已安装的文件,避免冲突 sudo apt-get remove ffmpeg x26 ...

  2. Linux下FFmpeg的安装编译过程【转】

    本文转载自:http://www.linuxidc.com/Linux/2013-06/85628.htm 详细说下在Linux下FFmpeg的安装编译过程.参考 Ubuntu 10.04安装编译FF ...

  3. linux下FFmpeg编译生成ffplay

    1.确认Makefile中指定的config.mak(在ffmpeg根目录下)中:CONFIG_FFPLAY=yes,如果不是需要重新./configure 该处还有ffmpeg.ffprobe.ff ...

  4. Linux下ffmpeg添加Facebook/transform代码块实现将全景视频的球模型转换成立方体模型

    Facebook事实上已开始在平台中支持360度全景视频的流播,但公司对此并不满足.其工程师更是基于锥体几何学设计出了一套全新的视频编码,号称最高能将全景视频的文件大小减少80%.(VR最新突破:全景 ...

  5. Linux下ffmpeg的wav与amr相互转换

    转载:http://blog.csdn.net/sanshipianyezi/article/details/78742621 转载:http://blog.csdn.net/szfhy/articl ...

  6. linux下ffmpeg环境搭建记录

    1.Linux下安装yasm 官网下载:http://yasm.tortall.net/Download.html tar -zvxf yasm-1.3.0.tar.gz cd yasm-1.3.0/ ...

  7. linux 下ffmpeg和mencoder安装

    ffmpeg和mencoder是进行视频转换和视频抽帧的重要开源工具,支持linux和windows环境下的视频转换和视频抽帧操作.本文章记录在linux这两者工具的安装过程.ffmpeg集成视频编码 ...

  8. linux下ffmpeg安装

    1.ffmpeg下载地址: http://www.ffmpeg.org/download.html 2.解压 1 $ tar zvfj ffmpeg.tar.bz2 这里作者假设已经重命名为ffmpe ...

  9. Linux下ffmpeg的完整安装

    最近在做一个企业项目, 期间需要将用户上传的视频转成flv格式或mp4格式并用flash插件在前端播放, 我决定采用ffmpeg (http://www.ffmpeg.org/ )实现. 当然以前也用 ...

随机推荐

  1. c++ find 函数与count函数

    1 algorithml中的find,还有就是string中的find 对对于第一种其调用形式为 find(start,end,value) start搜寻的起点,end搜寻的终点,要寻找的value ...

  2. PHP函数:func_num_args

    func_num_args()  - 返回传递给函数的参数数量. 说明: func_num_args ( void ) : int 参数: 无 返回值: 返回传入当前用户定义函数的参数数量. 参考链接 ...

  3. PHP函数:get_class()

    get_class()  -返回对象的类名 说明: get_class ([ object $object = NULL ] ) : string 参数: object:要测试的对象.如果在类里,此参 ...

  4. [PHP][thinkphp5] 学习二:路由、配置调用、常量定义调用

    路由: 其实TP5就是一个集多家框架所长而成的,感觉失去了自己的特色!路由这块呢类似于laravel框架!废话不说直接上码! 路由配置,类似laravel,就在route.php文件里配置路由(文件所 ...

  5. python 基础篇 匿名函数

    匿名函数基础 首先,什么是匿名函数呢?以下是匿名函数的格式: lambda argument1, argument2,... argumentN : expression 我们可以看到,匿名函数的关键 ...

  6. Python软件定时器APScheduler使用【软件定时器,非操作系统定时器,软件可控的定时器】【用途:定时同步数据库和缓存等】【刘新宇】

    APScheduler使用 APScheduler (advanceded python scheduler)是一款Python开发的定时任务工具. 文档地址 https://apscheduler. ...

  7. 关于log4j、jul、jcl、slf4j等等日志组件的理解

    日志组件: 我们经常在开发项目的时候,需要打印记录项目过程中的一些日志.那我们经常大概会用到 log4j.jul.jcl.slf4j.simple.nop.logback 等等,那我们就详细介绍下这些 ...

  8. GoJS 教程新手入门(资源整理,解决方案)

    以下几个是我在百度.谷歌 上能找到的比较全的GoJs的一些东西,希望对各位有所帮助! 如有外网网站不能访问请自行FQ GoJS官网 第一个推荐的是GoJS的一个类似于社区的问题讨论区,这里面初学者的一 ...

  9. Android-网页解析-gson的使用

    相对于较为传统的Json解析来说,google共享的开源Gson在解析速度和所使用的内存在有着明显的优势,虽然说阿里巴巴也提供了fastgson包,但是它跟Gson的处理速度大同小异,只是底层实现的原 ...

  10. Android--sos闪光灯

    Camera camera = null; Parameters parameters = null; Handler handler = new Handler() { @Override publ ...