参考博客先配置环境 https://blog.liboliu.com/a/75
- 安装vs2019
- 安装msys2
- 安装FFMPEG的依赖库文件
- 准备编译FFMPEG
- 编译FFMPEG
默认的编译只会编译ffmpeg和ffmpore,如果需要ffplay,还需要添加上–enable-sdl,
但是由于我们没有装SDL2库,所以SDL2_CONFIG找不到,所以就会出现:ERROR: sdl2 requested but not found 这种错误,所以我们还需要安装SDL库 - 安装SDL2
官网下载:https://www.libsdl.org/release/SDL2-2.0.8.tar.gz
下载完成后拷贝到“/home/source/”目录下,依次执行下列命令:
tar -zxvf SDL2-2.0.8.tar.gz
cd SDL2-2.0.8
./configure
make
make install
- 编译FFMpeg
cd /home/source/ffmpeg-4.3
./configure --enable-shared --enable-yasm --enable-libx264 --enable-avfilter --enable-gpl --enable-sdl --enable-avresample --enable-libfdk-aac --enable-nonfree
make -j4
make install
在/home/source/ffmpeg-4.3目录下可以看到编译成功的ffplay.exe 文件
参考文章:
https://blog.liboliu.com/a/75
https://blog.csdn.net/xiaoluer/article/details/84714769