FFmpeg 错误 C4996: "avcodec_alloc_frame"或者"av_free_packet"等函数被声明为已否决的解决方法

来源:互联网 发布:怎么让微博显示用mac 编辑:程序博客网 时间:2024/05/17 03:22

1 error C4996: "avcodec_alloc_frame"被声明为已否决

在 Visual Studio 2013 下编写 FFmpeg 程序时出错,错误如下:

出错代码如下:

解决方法为:
将 avcodec_alloc_frame() 替换为 av_frame_alloc()。

refer:
avcodec_alloc_frame is deprecated · Issue #3 · nareix/codec · GitHub

2 error c4996:"av_free_packet"被声明为已否决

尝试这个
1.Project Properties > Configuration Properties > C/C++ > General > SDL checks关掉
其他方法:
2.#pragma warning(disable: 4996)          
3。/wd 4996
1 0