VS配置FFMPEG(附编译好的库和inttypes.h及stdint.h)

在VS上配置ffmpeg时,需要对ffmpeg进行编译,比较麻烦。这里直接给出编译好的库,来自该博客,版本为ffmpeg4.2.1,有32位和64的。

1. VS配置说明

编译测试代码的过程中可能会遇到缺少inttypes.h和stdint.h,配置方法和相关文件可在下面的百度网盘中下载:
链接:https://pan.baidu.com/s/1-1IQKpCLxpKNA56ZkFPq5g
提取码:5429

2. 测试代码

main.cpp

// TEST CODE
#pragma comment(lib,"avcodec.lib")
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")
#pragma comment(lib,"avdevice.lib")
#pragma comment(lib,"avfilter.lib")
#pragma comment(lib,"postproc.lib")
#pragma comment(lib,"swresample.lib")
#pragma comment(lib,"swscale.lib")

#ifdef __cplusplus
extern "C" {
#endif
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#ifdef __cplusplus
} 
#endif

int main()
{
	rerurn 0;
}

3. linux编译

在linux上编译ffmpeg时,需要将原有的ffmpeg删掉,否则在使用的时候会报一些无法查找到函数的错误。通过该链接下载自己需要的版本,进行编译,编译方法比较简单,只需要下面几个步骤:

1. 将下载好的如ffmpeg-4.2.1.tar.gz解压得到ffmpg-4.2.1,cd进入ffmpeg
2. 执行:./configure,
3. 执行2的时候可能出现yasm找不到或者太old,需要先执行:sudo apt-get install yasm,再重新执行2
4. 执行:make -j8
5. 执行:make install
6. 结束:编译好的库在usr/local/lib和usr/local/include,在使用的时候把相关lib链接上即可。

参考链接:
https://blog.csdn.net/weixin_42949480/article/details/106439285?spm=1001.2014.3001.5502

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值