visual studio 2019 ffmpeg 开发环境配置

visual studio 2019 ; ffmpeg 开发环境配置

右键项目名称->属性->配置属性->c/c++->附加包含的目录:

1.加入以下:
D:\development path\ffmpeg-4.2.1-win64-dev\include
具体路径按照自己的情况定

2.项目名称->属性->配置属性->链接器->常规->附加库目录:
加入
D:\development path\ffmpeg-4.2.1-win64-dev\lib

3.项目名称->属性->配置属性->链接器->输入->附加依赖项:
加入
swscale.lib;avcodec.lib;avutil.lib;avformat.lib;
将D:\development path\ffmpeg-4.2.2-win64-shared\bin 下的dll拷贝到项目目录下

测试代码:

#include 

extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
}

int main(int argc, char* argv[]) {
    printf("%s\n", avcodec_configuration());
    return 0;
}

输出:

visual studio 2019 ffmpeg 开发环境配置_第1张图片

配置成功!

你可能感兴趣的:(visual studio 2019 ffmpeg 开发环境配置)