当前位置:网站首页>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)
边栏推荐
- Summary of the first week
- 弹性盒子flex
- [electronic circuit] how to select ADC chip
- Summary of knowledge points related to forms and forms
- rem与px与em异同点
- Playwright实战案例之爬取js加密数据
- Hcia-r & s self use notes (25) NAT technical background, NAT type and configuration
- 微信小程序-组件传参,状态管理
- Preemptive appointment | Alibaba cloud shadowless cloud application online conference appointment opens
- HCIA-R&S自用笔记(27)综合实验
猜你喜欢

Detailed explanation of serial port communication

Do students in the science class really understand the future career planning?

Day 3
![[typescript] in depth study of typescript functions](/img/0c/e838960c8efd6e87046d35f8942a07.png)
[typescript] in depth study of typescript functions
![[electronic circuit] how to select ADC chip](/img/41/05153704986117ce9adaa09cb71a7a.png)
[electronic circuit] how to select ADC chip

Qtcreator+cmake compiler settings

Wechat applet - screen height

Solve the problem that the prompt information of form verification does not disappear and the assignment does not take effect
![[typescript] learn typescript object types in depth](/img/87/a9fd2f177331863e06fcf14559eeed.png)
[typescript] learn typescript object types in depth

Liang Yuqi, founder of aitalk: the link between image and virtual reality
随机推荐
uniapp之常用提示弹框
Liang Yuqi, founder of aitalk: the link between image and virtual reality
公众号不支持markdown格式文件编写怎么办?
AR虚拟增强与现实
How does the MD editor of CSDN input superscripts and subscripts? The input method of formula and non formula is different
[untitled]
Day 2
ClickHouse学习(二)ClickHouse单机安装
利用Poi-tl在word模板表格单元格内一次插入多张图片和多行单元格相同数据自动合并的功能组件
The function of using wechat applet to scan code to log in to the PC web of the system
Topological ordering of a graph of water
弹性盒子相关知识
相对定位和绝对定位
[C language series] - print prime numbers between 100 and 200
2022 mathematical modeling competition summer training lecture - optimization method: goal planning
Detailed explanation of serial port communication
Hcia-r & s self use notes (27) comprehensive experiment
Flask 报错 RuntimeError: The session is unavailable because no secret key was set.
·Let's introduce ourselves to the way of programming·
Basic use of redis