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/ )实现. 当然以前也用 ...
随机推荐
- DataGridView行号发生变化 使用的事件
DataGridView并没有这么专门为行号发生变化时触发的事件,我们只能用SelectionChanged和CurrentCellChanged做些设置后实现. 1.使用SelectionChang ...
- 如何使用python,才能像人民日报的“点亮”武汉景点
如何使用python,才能像人民日报的“点亮”武汉景点 前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:Allen P ...
- J - The sum problem
Given a sequence 1,2,3,......N, your job is to calculate all the possible sub-sequences that the sum ...
- ExceptionInChainedOperatorException:flink写hbase对于null数据导致数据导致出现异常
使用的flink版本:1.9.1 异常描述 需求: 从kafka读取一条数据流 经过filter初次筛选符合要求的数据 然后通过map进行一次条件判断再解析.这个这个过程中可能返回null或目标输出o ...
- .NET 4 实践 - 使用dynamic和MEF实现轻量级的AOP组件 (4)
转摘 https://www.cnblogs.com/niceWk/archive/2010/07/23/1783394.html 借花献佛 前面我们介绍了构成DynamicAspect绝大部分的类, ...
- Golang Map实现(一)
本文学习 Golang 的 Map 数据结构,以及map buckets 的数据组织结构. hash 表是什么 从大学的课本里面,我们学到:hash 表其实就是将key 通过hash算法映射到数组的某 ...
- sqli lab less-5-6
less-5 基于报错的注入 基于报错可以爆出当前数据库名等等 id=2' and extractvalue(1, concat(0x7c,(select user())));-- # ?id=2' ...
- JS - Promise使用详解
参考:https://www.cnblogs.com/developer-ios/p/10510564.html
- thinkPHP--关于域名指向的问题
一般项目的域名指向都是可以直接配置的,在默认的情况下.一般都是指向index.php文件.我就直接上图吧,这里是用我的公司项目名称www.xcj.com为域名. 一般的进入项目,调用默认的控制器: h ...
- java.util.concurrent简介
文章目录 主要的组件 Executor ExecutorService ScheduledExecutorService Future CountDownLatch CyclicBarrier Sem ...