ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 7349|回复: 3

[Windows] 学习过程中ffmpeg中遇到问题

[复制链接]
发表于 2018-2-26 16:41:41 | 显示全部楼层 |阅读模式
使用除avformat外的所以库都不能连接动态链接库
#include "QtGuiApplication1.h"
#include <QtWidgets/QApplication>
#include <QDebug.h>
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")
#pragma comment(lib,"avcodec.lib")
extern "C"
{
       #include <libavformat\avformat.h>
       #include <libavutil\avutil.h>
       #include <libavcodec\avcodec.h>
}
int main(int argc, char *argv[])
{
       av_register_all();
       qDebug() <<"av_register_all is finished\n";
       char *path = "test.mp4";
       AVFormatContext *ic=NULL;
       int re =avformat_open_input(&ic,path,0,0);
       if (re != 0)
       {
             //char errbuf[1024] = {0};
             //av_strerror(re, errbuf, sizeof(errbuf));
             printf("open failed");
             getchar();
             return -1;
       }
       int timebase = ic->duration /AV_TIME_BASE;
       qDebug() << timebase / 60<< "minutil" << timebase % 60 << "sec"<< "\n";
       AVPacket pkt;
       re=av_read_frame(ic, &pkt);
       av_packet_unref(&pkt);
       avformat_close_input(&ic);
       QApplication a(argc, argv);
       QtGuiApplication1 w;
       w.show();
       return a.exec();
}
提示:
无法定位程序输入点av_packet_unref于动态链接库
G:\Visual_Studio\QtGuiApplication\x64\Debug\QGuiApplication1.exe

回复

使用道具 举报

发表于 2018-2-26 18:59:16 | 显示全部楼层
一般是.lib 和 .dll 不对应,才会导致这样的问题
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-2-26 20:17:05 | 显示全部楼层
孙悟空 发表于 2018-2-26 18:59
一般是.lib 和 .dll 不对应,才会导致这样的问题

我使用x86的没问题。x64要怎么配置
回复 支持 反对

使用道具 举报

发表于 2018-2-27 14:12:06 | 显示全部楼层
hehuabbs 发表于 2018-2-26 20:17
我使用x86的没问题。x64要怎么配置

怎么安装的呢?安装的目录是不是需要特别设置一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-4-20 16:46 , Processed in 0.048187 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表