Linux下ffmpeg交叉编译
1 获取源代码
git clone -b "branch" https://git.ffmpeg.org/ffmpeg.git
“branch” 可以是以下的master、release/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.
解决方案:
打开configure文件;
搜索报错内容“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交叉编译的更多相关文章
- Linux下ffmpeg安装与开发配置
Linux下ffmpeg安装与开发配置 1. ffmpeg安装 安装环境: ubuntu 12.04 (1)删除已安装的文件,避免冲突 sudo apt-get remove ffmpeg x26 ...
- Linux下FFmpeg的安装编译过程【转】
本文转载自:http://www.linuxidc.com/Linux/2013-06/85628.htm 详细说下在Linux下FFmpeg的安装编译过程.参考 Ubuntu 10.04安装编译FF ...
- linux下FFmpeg编译生成ffplay
1.确认Makefile中指定的config.mak(在ffmpeg根目录下)中:CONFIG_FFPLAY=yes,如果不是需要重新./configure 该处还有ffmpeg.ffprobe.ff ...
- Linux下ffmpeg添加Facebook/transform代码块实现将全景视频的球模型转换成立方体模型
Facebook事实上已开始在平台中支持360度全景视频的流播,但公司对此并不满足.其工程师更是基于锥体几何学设计出了一套全新的视频编码,号称最高能将全景视频的文件大小减少80%.(VR最新突破:全景 ...
- Linux下ffmpeg的wav与amr相互转换
转载:http://blog.csdn.net/sanshipianyezi/article/details/78742621 转载:http://blog.csdn.net/szfhy/articl ...
- linux下ffmpeg环境搭建记录
1.Linux下安装yasm 官网下载:http://yasm.tortall.net/Download.html tar -zvxf yasm-1.3.0.tar.gz cd yasm-1.3.0/ ...
- linux 下ffmpeg和mencoder安装
ffmpeg和mencoder是进行视频转换和视频抽帧的重要开源工具,支持linux和windows环境下的视频转换和视频抽帧操作.本文章记录在linux这两者工具的安装过程.ffmpeg集成视频编码 ...
- linux下ffmpeg安装
1.ffmpeg下载地址: http://www.ffmpeg.org/download.html 2.解压 1 $ tar zvfj ffmpeg.tar.bz2 这里作者假设已经重命名为ffmpe ...
- Linux下ffmpeg的完整安装
最近在做一个企业项目, 期间需要将用户上传的视频转成flv格式或mp4格式并用flash插件在前端播放, 我决定采用ffmpeg (http://www.ffmpeg.org/ )实现. 当然以前也用 ...
随机推荐
- 一站式轻量级框架 Spring
Spring 简介 Spring 是一个轻量级的 Java 开发框架,它是为了解决企业应用开发的复杂性而创建的.Spring 的核心是控制反转(IoC)和面向切面编程(AOP).简单来说,Spring ...
- GIT生成ssh(window7系统)——git工具篇
由于本地git仓库和github仓库直接的传递需要ssh加密的,所以必须要生成ssh,下面是具体的操作步骤: 1.打开GIT命令行,输入命令:ssh-keygen -t rsa -C "yo ...
- 进阶 Linux基本命令-1
vmware三种网络模式1,桥接虚拟机直接连接外网,局域网.宿主机电脑不提供路由. 2,NAT网络地址转换,家庭网 3,host only 只能和宿主电脑打交道 Linux命令形式 命令 +[参数]+ ...
- 二分查找(通过相对位置判断区间位置)--17--二分--LeetCode33搜索旋转排序数组
搜索旋转排序数组 假设按照升序排序的数组在预先未知的某个点上进行了旋转.( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] ). 搜索一个给定的目标值,如果数组中 ...
- java redis面试专题(附答案)
1.什么是Redis?简述它的优缺点? Redis的全称是:Remote Dictionary.Server,本质上是一个Key-Value类型的内存数据库,很像 memcached,整个数据库统统加 ...
- php 全局变量和超全局变量
global 全局变量(在当前页面全部地方有效) $GLOBALS['name'] 超全局变量(在整个网站全部地方有效) 一个包含了全部变量的全局组合数组.变量的名字就是数组的键.还有_GET,_PO ...
- CG-CTF(1)
CG-CTF CG-CTF题目网址:https://cgctf.nuptsast.com/challenges#Web 第一题:签到题 查看页面源代码,得到flag(干杯~): 第二题:md5 col ...
- ansible的基础概念与部署(一)
- C++ 重载运算符 继承 多态 (超详细)
(一)重载运算符: (1)声明与定义格式 一般是类内声明,类外定义,虽然可以在类内定义,但 写前面堆一堆不好看!!! 类内声明: class Demo { 返回值类型 operator 运算符(形参表 ...
- unittest(简介)
一.unittest框架介绍: unittest框架是python中的一个单元测试框架,该模块包括许多的类如 TestCase 类.TestSuite 类.TextTestRunner 类.TestR ...