没志青年
发布于 2025-09-08 / 12 阅读
0

FFmpeg 编译

FFmpeg官方下载地址:Download FFmpeg

暂时没弄x264

编译配置参数

参数

默认值

说明

--prefix=

--enable-cross-compile

--arch=arm

--cpu=cortex-a7

--target-os=linux

--enable-shared

生成共享库

--disable-static

禁止生成静态库

--enable-libx264

添加x264库支持

Linux编译

下载 ffmpeg-6.1.2 并解压

tar -zxvf ffmpeg-6.1.2.tar.gz

安装必要依赖

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make -j4
sudo make install

sudo apt-get install pkg-config
./configure --prefix=$PWD/build-x86
make -j4
make install

Lniux交叉编译

嵌入式linux下的FFmpeg交叉编译(最全面)-CSDN博客

./configure \
    --prefix=$PWD/build-arm32 \
    --cross-prefix=arm-linux-gnueabihf- \
    --target-os=linux \
    --enable-cross-compile \
    --arch=arm \
    --cpu=cortex-a7 \
    --enable-shared
    --enable-static
    --enable-encoder=libx264 \
	--enable-libx264 \
	--extra-cflags=-I264的头文件目录 \   
	--extra-ldflags=-L264库文件目录
原文链接:https://blog.csdn.net/corefunction/article/details/112653207

遇到警告 WARNING: arm-linux-gnueabihf-pkg-config not found, library detection may fail. 我也不知道怎么解决,反正编译成功了。

Windows编译

FFmpeg链接库的顺序

avfilter

avcodec

avformat

swscale

avutil

swresample