当前位置:网站首页>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)
边栏推荐
猜你喜欢

Day 3

Question swiping Madness - leetcode's sword finger offer58 - ii Detailed explanation of left rotation string

Set the background color of a cell in the table

On Paradigm

Day 5

Database operation day 6

MySQL解压版windows安装

Cmu15-213 shell lab experiment record

ClickHouse学习(二)ClickHouse单机安装

ClickHouse学习(十)监控运行指标
随机推荐
无重复字符的最长字串
Question swiping Madness - leetcode's sword finger offer58 - ii Detailed explanation of left rotation string
基础爬虫实战案例之获取游戏商品数据
ClickHouse学习(十)监控运行指标
实现table某个单元格背景色设置
uniapp组件之tab选项卡滑动切换
【TypeScript】深入学习TypeScript函数
Clickhouse learning (x) monitoring operation indicators
Qtcreator+cmake compiler settings
HCIA-R&S自用笔记(24)ACL
力扣994:腐烂的橘子(BFS)
Merge the same items in the same column in table
shell基本操作(下)
link与@import的关系
[untitled]
365 day challenge leetcode 1000 questions - day 035 one question per day + two point search 13
表格与表单相关知识点总结
Hcia-r & s self use notes (25) NAT technical background, NAT type and configuration
Day 3
Selenium实战案例之爬取js加密数据