win10 vs2017 ShiftMediaProject/ffmpeg 工程编译 踩过的坑 总结篇

win10 vs2017 ShiftMediaProject/ffmpeg 工程编译 踩过的坑 总结篇

今天踩了一遍雷,就顺手写点东西分享一下,避免大家继续踩雷。

1、下载ShiftMediaProject/ffmpeg 工程

这是该工程的GitHub地址 ShiftMediaProject

git clone https://github.com/ShiftMediaProject/FFmpeg.git

2、pull ffmpeg 第三方依赖库

使用管理员权限启动CMD,cd 到SMP文件夹 ,运行project_get_dependencies.bat
该过程是,pull ffmpegde依赖的第三方库,建议开VPN。
在这里插入图片描述在这里插入图片描述
运行完 得到的文件如下图所示:
在这里插入图片描述

3、安装额外的include 头文件 到FFmpeg/…/…/msvc/include 文件夹

  1. opengl (requires glext)
    a) Download glext.h and wglext.h from opengl.org.
    b) Save the header files into “OutputDir/include/gl/".
    c) Download khrplatform.h from khronos.org
    d) Save the header file into "OutputDir/include/KHR/
    ”.
    2) ffnvcodec (requires nv-codec-headers)
    a) Download the nv-codec-headers repository from https://github.com/FFmpeg/nv-codec-headers
    b) Save the contents of the nv-codec-headers repositories “include” folder into “OutputDir/include/".
    3) AMF (requires Advanced Media Framework (AMF) SDK headers)
    a) Download the AMF repository from https://github.com/GPUOpen-LibrariesAndSDKs/AMF
    b) Save the contents of the AMF repositories “amf/public/include” into "OutputDir/include/AMF/
    ”.

4、安装VSNASM与VSYASM

VSNASM 地址:https://github.com/ShiftMediaProject/VSNASM/releases/tag/0.6
VSYASM地址: https://github.com/ShiftMediaProject/VSYASM/releases

分别运行 install_script.bat 脚本文件
一般YASM 不会有什么问题,如果NASM安装不上,可以手动下载安装包,nasm-2.14.02-win64.zip然后修改install_script.bat

set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
set NASMDOWNLOAD=%NASMDL%/%NASMVERSION%/win%SYSARCH%/nasm-%NASMVERSION%-win%SYSARCH%.zip
换为
set NASMDL=.
set NASMDOWNLOAD=%NASMDL%/nasm-%NASMVERSION%-win%SYSARCH%.zip

5、编译

打开ffmpeg_deps.sln文件
在这里插入图片描述
如果打开的是ffmpeg.sln 文件编译的话 会出现一大堆的.h头文件找不到的问题。

如果要生成dll文件,则将工程中 ffmpeg ffplay ffprobe 的配置类型 改为.dll动态库即可。

6、可能遇到的问题

由于我没有将问题的详细信息保存下来,就不多说。一般都是本地库与远端库不匹配造成的问题,尽量使用git 保证一致,就能编译通过。一定不要更改git获取的文件内容。

发布了7 篇原创文章 · 获赞 3 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/hanxu117160/article/details/103977852
今日推荐