win10 vs2017 ShiftMediaProject / ffmpeg compile the project stepped pit summary article

win10 vs2017 ShiftMediaProject / ffmpeg compile the project stepped pit summary article

Today, step on mine again, it easily write something to share, we continue to avoid step on mine.

1, download ShiftMediaProject / ffmpeg project

This is the address of the GitHub project ShiftMediaProject

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

2, pull ffmpeg dependent on third-party libraries

Use administrator privileges to start CMD, cd to the SMP folder, run project_get_dependencies.bat
the process, pull ffmpegde rely on third-party libraries, proposed to open VPN.
Here Insert Picture DescriptionHere Insert Picture Description
Runs out of files obtained as shown below:
Here Insert Picture Description

3, install additional header files to include FFmpeg / ... / ... / msvc / include folder

  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文件
Here Insert Picture Description
如果打开的是ffmpeg.sln 文件编译的话 会出现一大堆的.h头文件找不到的问题。

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

6、可能遇到的问题

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

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

Guess you like

Origin blog.csdn.net/hanxu117160/article/details/103977852