当前位置:网站首页>WIN10 编译ffmpeg(包含ffplay)
WIN10 编译ffmpeg(包含ffplay)
2022-07-29 05:18:00 【cloud_yq】
1、安装MSYS2
Win10 搭建MSYS2环境_cloud_yq的博客-CSDN博客
2、编译SDL
SDL是编译生成ffplay的基础,不需要生成ffplay可不编译SDL。
1)下载地址:https://www.libsdl.org/download-2.0.php
2)由于采用MSYS2下编译,下载SDL2-2.0.22.tar.gz - GPG signed这个包。
3)编译步骤
step1、mkdir /usr/local/SDL2 这个路径用来存放SDL编译后文件,可改(改后后续其他地方也要同步修改)
step2、./configure --prefix=$MSYS2/usr/local/SDL2/ 这里$MSYS2表示自己的MSYS2安装目录(是自己情况修改)。
step3、make
step4、 make install
编译成功之后会在$MSYS2/usr/local/SDL2/ 相应的库目录(没有生成需要仔细检查以上三步是否有报错):

4)、记录编译过程一个报错,在SDL2-2.0.18和SDL2-2.0.22版本都遇到了。make步骤编译SDL_windows_gaming_input.c,报错信息如下:
make: *** [makefile:730: build/sdl_windows_gaming_input.lo] error 1

这里应该是windows定义类型和linux有差别,需要修改下 SDL_windows_gaming_input.c($MSYS2/home/source/SDL2-2.0.18/src/joystick/windows)文件,增加新的宏(此处是参考SDL issue解决,路径贴在末尾)。修改内容如下:
//增加宏
#ifdef __MINGW32__
#define __FIReference_1_int __FIReference_1_INT32
#define __FIReference_1_int_get_Value __FIReference_1_INT32_get_Value
#define __FIReference_1_int_Release __FIReference_1_INT32_Release
#endif
//源代码
struct joystick_hwdata
{
__x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller;
__x_ABI_CWindows_CGaming_CInput_CIGameController *gamecontroller;
__x_ABI_CWindows_CGaming_CInput_CIGameControllerBatteryInfo *battery;
__x_ABI_CWindows_CGaming_CInput_CIGamepad *gamepad;
__x_ABI_CWindows_CGaming_CInput_CGamepadVibration vibration;
UINT64 timestamp;
};3、编译ffmpeg
1)、需要配置下环境
在mingw64命令窗口中执行一下命令:
1、Pacman -S nasm
2、Pacman -S yasm
3、Pacman -S make cmake
4、 Pacman -S diffutils
2)、设置SDL2的库目录
export PATH="/usr/local/SDL2/bin/:$PATH"
3)、ffmpeg编译指令
1、./configure --enable-shared --disable-static --enable-debug --enable-sdl2 --extra-cflags='-I/usr/local/SDL2/include/SDL2/' --extra-ldflags='-L/usr/local/SDL2/lib/' --prefix=/home/source/ffmpeg_build/
2、make
3、make install编译成功后生成的库文件就在 /home/source/ffmpeg_build/ 目录下。
4、参考文章
Windows下编译可调试的ffmpeg, 包含ffplay_shizheng163的博客-CSDN博客
compilability of WGI code against MinGW headers · Issue #5589 · libsdl-org/SDL (github.com)
边栏推荐
猜你喜欢
![[JS question solution] questions 1-10 in JS of niuke.com](/img/9d/4bae4a9a048e4e5412f157ec632c94.png)
[JS question solution] questions 1-10 in JS of niuke.com

Cmu15-213 shell lab experiment record
![[C language series] - realize the exchange of two numbers without creating the third variable](/img/7c/468000bcbf740c9dd3535f2734728a.png)
[C language series] - realize the exchange of two numbers without creating the third variable

Realize simple database query (incomplete)
![[sword finger offer] - explain the library function ATOI and simulate the realization of ATOI function](/img/13/a506861da2db8f5a5181e6d82894b3.png)
[sword finger offer] - explain the library function ATOI and simulate the realization of ATOI function

ClickHouse学习(八)物化视图

Day 1

eggjs 创建应用知识点

Day 2

关于局部变量
随机推荐
用threejs 技术做游戏跑酷
Do students in the science class really understand the future career planning?
Cmu15-213 shell lab experiment record
js简单代码判断打开页面的设备是电脑PC端或手机H5端或微信端
Allocate memory: malloc() and free()
Thrift安装手册
H5语义化标签
[C language series] - detailed explanation of file operation (Part 1)
JS deep copy - Notes
Clickhouse learning (XI) clickhouseapi operation
Integer overflow and printing
Alibaba cloud and Dingjie software released the cloud digital factory solution to realize the localized deployment of cloud MES system
【TypeScript】深入学习TypeScript函数
[C language series] - three methods to simulate the implementation of strlen library functions
Pyqt5: Chapter 1, Section 1: creating a user interface using QT components - Introduction
小程序中的DOM对象元素块动态排序
Flask 报错 RuntimeError: The session is unavailable because no secret key was set.
link与@import的关系
ClickHouse学习(四)SQL操作
MySQL解压版windows安装