gpt4 book ai didi

ffmpeg:调用 av_register_all 失败

转载 作者:行者123 更新时间:2023-12-04 23:30:00 24 4
gpt4 key购买 nike

我有一个使用 ffmpeg 解码视频帧的 Windows 7 应用程序。

它使用的是旧版本的 ffmpeg(不确定是哪一个),但它工作正常,除了从增加的线程数调用 avcodec_decode_video2 时出现一些解码错误。

所以我决定将 ffmpeg 升级到更新版本并获得 2.1.1(最新)。
我把它弄下来了http://ffmpeg.zeranoe.com/builds/

我设法使用新的包含/库来编译应用程序。

但是,当我运行应用程序时,它会抛出一个异常,即在 dll 加载期间找不到函数。
我将其追溯到 avformat.lib 和 avformat-55.dll 中的 av_register_all()。

看起来 ffmpeg 库中这个函数的定义在版本上有所改变。它不再指向 avformat-55.dll(我无法使用 dumpbin 找到)。

那么从 C++ dll 调用此函数的最佳方法是什么?

目前,在我的包含文件中,我有这个:

extern "C" 
{
#include "libavutil\dict.h"
#include "libavcodec\avcodec.h"
#include "libavformat\avformat.h"

};

#pragma comment(lib,"avcodec.lib")
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")

非常感谢!

提供

最佳答案

根据这篇文章,解决方案原来是一个简单的链接器选项/OPT:NOREF:

The procedure entry point could not be located in the dynamic link library - looking in wrong DLL

关于ffmpeg:调用 av_register_all 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20684895/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com