当前位置: 首页 > ai >正文

Ubuntu24.04 交叉编译 aarch64 ffmpeg

ffmpeg

  • 官网: https://ffmpeg.org
  • 文档: https://ffmpeg.org/documentation.html
    • 编译参数说明: https://trac.ffmpeg.org/wiki/CompilationGuide/Generic
    • 在Linux下编译: https://trac.ffmpeg.org/wiki/CompilationGuide
  • 下载页: https://ffmpeg.org/download.html

安装依赖

sudo apt install \autoconf \automake \build-essential \cmake \git-core \libass-dev \libfreetype6-dev \libgnutls28-dev \libmp3lame-dev \libsdl2-dev \libtool \libva-dev \libvdpau-dev \libvorbis-dev \libxcb1-dev \libxcb-shm0-dev \libxcb-xfixes0-dev \meson \ninja-build \pkg-config \texinfo \wget \yasm \zlib1g-devsudo apt install libunistring-dev libaom-dev libdav1d-dev

下载源代码

下载页拉到下方 Releases 位置, 下载最新的代码包, 当前版本是 FFmpeg 7.1.1 “Péter”

解压到本地, 在与 ffmpeg-7.1.1 同一级目录下再建一个目录用作 install 的目标目录

configure

设置交叉编译的gcc工具链路径, 设置 install 的目标路径

通过./configure --help可以查看所有的选项.

如果只编译指定的解码器, 可以用--disable-decoders --enable-decoder=h264这样的参数组合, 编码器也是同理.

默认编译所有的编解码器, 执行 configure

./configure --enable-cross-compile --target-os=linux --arch=arm64 \
--cross-prefix=/opt/gcc-arm/aarch64-buildroot-linux-gnu-gcc-12.3.0/bin/aarch64-buildroot-linux-gnu- \
--cc=/opt/gcc-arm/aarch64-buildroot-linux-gnu-gcc-12.3.0/bin/aarch64-buildroot-linux-gnu-gcc \
--cxx=/opt/gcc-arm/aarch64-buildroot-linux-gnu-gcc-12.3.0/bin/aarch64-buildroot-linux-gnu-g++ \
--prefix=/home/milton/WorkC/ffmpeg-7.1.1-lib \
--disable-asm  --enable-parsers --disable-debug \
--enable-ffmpeg --enable-shared --disable-static \
--disable-stripping --disable-doc

然后编译

make -j4

安装

make install

会在目录下生成对应的 bin, include 和 lib

├── bin
│   ├── ffmpeg
│   └── ffprobe
├── include
│   ├── libavcodec
│   ├── libavdevice
│   ├── libavfilter
│   ├── libavformat
│   ├── libavutil
│   ├── libswresample
│   └── libswscale
├── lib
│   ├── libavcodec.so -> libavcodec.so.61.19.101
│   ├── libavcodec.so.61 -> libavcodec.so.61.19.101
│   ├── libavcodec.so.61.19.101
|   |   ...
│   ├── libswscale.so.8 -> libswscale.so.8.3.100
│   ├── libswscale.so.8.3.100
│   └── pkgconfig
└── share└── ffmpeg

查看二进制文件是X64还是Aarch64

file

$ file bin/ffmpeg
bin/ffmpeg: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, with debug_info, not stripped

objdump

$ objdump -f bin/ffmpeg bin/ffmpeg:     file format elf64-little
architecture: UNKNOWN!, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000000000000edc0

readelf

$ readelf -h bin/ffmpeg
ELF Header:Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class:                             ELF64Data:                              2's complement, little endianVersion:                           1 (current)OS/ABI:                            UNIX - System VABI Version:                       0Type:                              DYN (Position-Independent Executable file)Machine:                           AArch64Version:                           0x1Entry point address:               0xedc0Start of program headers:          64 (bytes into file)Start of section headers:          382240 (bytes into file)Flags:                             0x0Size of this header:               64 (bytes)Size of program headers:           56 (bytes)Number of program headers:         9Size of section headers:           64 (bytes)Number of section headers:         37Section header string table index: 36
http://www.xdnf.cn/news/11735.html

相关文章:

  • 多分辨率 LCD 的 GUI 架构设计与实现
  • AI基础知识(LLM、prompt、rag、embedding、rerank、mcp、agent、多模态)
  • 【Qt开发】文件
  • 【Linux仓库】冯诺依曼体系结构与操作系统【进程·壹】
  • 一台电脑联网如何共享另一台电脑?网线方式
  • Mermaid 绘图--以企业权限视图为例
  • 【后端开发】goland分布式锁的几种实现方式(mysql,redis,etcd,zookeeper,mq,s3)
  • WordPress子主题RiPro-V5van无授权全开源版(源码下载)
  • 实践篇:利用ragas在自己RAG上实现LLM评估②
  • 【Pandas】pandas DataFrame sample
  • sql server如何创建表导入excel的数据
  • 虚拟斯德哥尔摩症候群:用户为何为缺陷AI辩护?
  • 搭建强化推荐的决策服务架构
  • 【深度学习优化算法】02:凸性
  • 深度探索:如何用DeepSeek重构你的工作流
  • HTML5 网页设计 基础
  • 网页加密/解密( ecode方式)
  • UVM糖果爱好者教程 - 27.打印消息冗余度
  • 使用ExtendSim进行水管理、可持续性和环境仿真建模
  • 推荐5个免费的字体转换网站工具
  • iOS开发_常用的正则表达式
  • MATCH_PARENT与FILL_PARENT:不要做什么和怎么做
  • Android 系统升级流程分析
  • 0-1背包问题(回溯法c++详解)
  • STM32外部挂载SDcard+移植Fatfs文件系统
  • tl r402路由器设置_tplogin.cn登录路由器怎么设置 tplogin.cn登录路由器设置步骤【详解】...
  • Android光线传感器获取光线强弱。LightSensorManager封装类
  • position的relative与absolute的区别
  • 非线性丙类功率放大器实验_倾斜光纤Bragg光栅:抑制高功率光纤激光系统SRS和SBS的理想选择...
  • 网安学习日志01:用kali复现ms17-010漏洞