这个文章应该算是中文版最好的了。但是还有一些需要修正。 特别是winsock2的处理

win10 msys2 vs2015 ffmpeg3.2.2 编译

这个英文版的才是最好的

Building ffmpeg 3.3 with MSYS2 + MSVC 2017 failed with so many winsock2 related redefinitions

MSYS2 + Visual Studio  Community here, the exact steps I take to build are:
. Start a Visual Studio "Developer Command Prompt", which effectively run vcvars.bat
. cd into msys64 directory, and then invoke MSYS2 within the command prompt with "msys2_shell.cmd -msys2 -use-full-path", which make msys2 inherited the envs set by vcvars
. In MSYS2 shell, cd into /somewhere/ffmpeg-build/
. rm -rf *
. run "../ffmpeg-3.3/configure --prefix=/somewhre/to/install/ffmpeg-bin --toolchain=msvc" in the build folder. configure script complete successfully.
. make and then during the build, after about half done, so many winsocks2 functions related redefinition fail the build.
And I've found an easy fix, that is "../ffmpeg-3.3/configure --prefix=/somewhre/to/install/ffmpeg-bin --toolchain=msvc --extra-cflags=-DWIN32_LEAN_AND_MEAN".

但是,还是有几个问题

1) 想要debug版的,所以还加上了 --enable-debug

2) 不想要 Warning消息,所以 configure 之后,编辑 config.mak , 把-W4 改成了 -w

CFLAGS= -nologo -DWIN32_LEAN_AND_MEAN   -Z7 -w

3)   cmdutils.c 卡在了 【AVOutputFormat *ofmt = NULL;】 , 查错误代码想了半天,才知道VC应该用下面的语法

struct AVOutputFormat *ofmt = NULL;

4) cmdutils.c 还卡在了【 av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT);】

把参数一个一个排除,发觉问题出在 CC_IDENT .

最后把 config.h里的中文定义改成英文的才解决。 我也不想用中文版的,可是我不知道安装完之后,还能怎么改。

// #define CC_IDENT "用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.10.25019 版"
#define CC_IDENT "MSVC19.10.25019"

5) SDL的编译

a) 网站已经有mingw的开发库,下载就可以 http://www.libsdl.org/download-2.0.php

b) 自己用source 在 mingw 编译。

../configure --host=x86_64-w64-mingw32

    c) make 会出error . 因为 SDL 的source 没有根据最新mingw做变更。

需要注释掉 SDL2-2.0.5\src\core\windows\SDL_xinput.h 的下面的代码

typedef struct XXX XINPUT_GAMEPAD_EX   typedef struct  XINPUT_STATE_EX;

6) x264的编译 , 屏蔽了几个模块。 这个好像是source级别的mingw限制。

因为这个不会生成libx264.lib,废弃    ../configure --host=x86_64-w64-mingw32 --enable-shared --disable-thread --disable-avs

a) ../configure --host=x86_64-w64-mingw32 --disable-thread  --disable-cli --enable-shared --extra-ldflags=-Wl,--output-def=libx264.def

b) make 成功之后,拷贝 .def 文件到 /usr/local/lib

c) 在 /usr/local/lib 执行 lib.exe /DEF:libx264.def

最后,ffplay 还是没有编译成功,太累了。

$ ../configure --toolchain=msvc   --extra-ldflags="-Libpath:/usr/local/lib" --extra-cflags='-DWIN32_LEAN_AND_MEAN -I/usr/include -I/usr/include/SDL2 -I/usr/local/include ' --enable-debug --enable-libx264 --enable-gpl --enable-shared --enable-static --enable-ffplay

compile FFMPEG under windows的更多相关文章

  1. Compile FreeCAD on Windows

    Compile FreeCAD on Windows eryar@163.com 1.Introduction FreeCAD是一个参数化的三维造型软件,主要用于任意大小的实际模型的设计.参数化的建模 ...

  2. FFMPEG在windows平台编译的详细过程,包括环境安装

    下面开始: 由于FFMpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译.要想使用FFMpeg ...

  3. 使用FFMPEG在windows平台下推rtmp流

    使用FFMPEG在windows平台下推rtmp流 工作中习惯在Linux下面使用FFmpeg模拟推rtmp流,无奈家中的电脑都是windows系统,需要利用家中的带宽来测试流媒体服务器的性能.所以研 ...

  4. windows 10上源码编译dlib教程 | compile dlib on windows 10

    本文首发于个人博客https://kezunlin.me/post/654a6d04/,欢迎阅读! compile dlib on windows 10 Series Part 1: compile ...

  5. windows 10 上源码编译opengv | compile opengv on windows 10 from source

    本文首发于个人博客https://kezunlin.me/post/51cd9fa0/,欢迎阅读! compile opengv on windows 10 from source Series co ...

  6. ffmpeg+x264 Windows MSVC 静态编译

    尝试ubuntu和win下mingw编译版本,但都在Vistual Studio链接时因为依赖 libgcc.a, libmingw.a, libmingwex.a 会与mscrt 有符号冲突. 最后 ...

  7. 【FFmpeg】Windows下64位ffmpeg编译

    本文主要记录在64位Windows 7下,编译64位ffmpeg的过程. 1.资源准备 (1). MSYS http://sourceforge.net/projects/mingwbuilds/fi ...

  8. 【FFmpeg】Windows下FFmpeg调试

    为了深入了解ffmpeg的工作原理,需要阅读源代码,调试源代码.在Windows下调试ffmpeg源码,一种方法是在MinGW+Msys环境下,利用GDB进行调试:另一种是借助Eclipse进调试,其 ...

  9. 【FFmpeg】Windows下FFmpeg编译

    由于FFmpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译,需要在Windows下配置一个类 ...

随机推荐

  1. Oracle redo/undo 原理理解

    一. 什么是redo(用于重做数据) redo也就是重做日志文件(redo log file),Oracle维护着两类重做日志文件:在线(online)重做日志文件和归档(archived)重做日志文 ...

  2. oracle RAC如何正确地删除ASM磁盘组

    1.登录到命令行 切换到grid用户 [grid@swnode1 ~]$ sqlplus / as sysasm SQL*Plus: Release Production on Wed May :: ...

  3. 第三周作业HAproxy文件操作

    #coding:utf-8 #Author:Mr Zhi """ HAproxy配置文件操作: 1. 根据用户输入输出对应的backend下的server信息 2. 可添 ...

  4. JS实现对数器

    对数器的概念和使用 对数器一般用于验证你写的算法是否正确,因为自己写的测试用例可能写的考虑不够全面. 0.有一个你想测试的方法a 1.实现一个绝对正确但是时间复杂度不好的方法b 2.实现一个随机样本产 ...

  5. Node.js初探

    1, 设计高性能.Web服务器的几个要点:事件驱动.非阻塞I/O 2,常见Web服务器架构: Web服务器的功能: 接受HTTP请求(GET.POST.DELETE.PUT.PATCH) 处理HTTP ...

  6. python---02.while循环 格式化输出 运算符 编码

    一.while循环语句 1.while 条件:(如果条件是真, 则直接执⾏循环体. 然后再次判断条件. 直到条件是假. 停⽌循环) 循环体(break  continue) 2. break: 立刻跳 ...

  7. 浅尝flutter中的http请求

    import 'package:flutter/material.dart'; class News extends StatefulWidget { final String title,imgli ...

  8. linux基础之vim编辑器

    vi : Visual Interface vim : VI Improved : VI的基础加上一些有用的插件 vim编辑器: 文本编辑器, 字处理器, 全屏编辑器, 模式化编辑器 vim的模式有三 ...

  9. 思维|蚂蚁感冒|2014年蓝桥杯A组题解析第七题-fishers

    标题:蚂蚁感冒 长100厘米的细长直杆子上有n只蚂蚁.它们的头有的朝左,有的朝右. 每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒. 当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行. 这些蚂蚁中,有 ...

  10. Newcoder 华华给月月出题(线筛)题解

    题目描述: 华华刚刚帮月月完成了作业.为了展示自己的学习水平之高超,华华还给月月出了一道类似的题: Ans=⊕Ni=1(iNmod(109+7))Ans=⊕i=1N(iNmod(109+7)) ⊕⊕符 ...