ffmpeg包含问题-缺少一些功能

ffmpeg include issue - some functions are missing

本文关键字:功能 包含 问题 ffmpeg      更新时间:2023-10-16

由于FFMPEG,我尝试遵循并调整此示例以转换视频,但似乎缺少一些功能,如:

int avcodec_open ( AVCodecContext * avctx, AVCodec * codec)     

当我进入文档查看它的来源时,我会在文件libavcodec/avcodec.h中找到它,该文件包含在我的程序#include "libavcodec/avcodec.h"中(在我的.h文件的顶部)。

鉴于此,我不明白为什么Qt会给我这个错误:

../../Dev/Joker/libs/PhVideo/PhVideoEncoder.cpp:360:6: error: use of undeclared identifier 'avcodec_open'
    if (avcodec_open(c, codec) < 0) {

avcodec_open已被弃用,并在较新版本的FFMPEG中被avcodec_open2取代。

请参阅最新文档,此处和此处