繁体   English   中英

在使用ffmpeg的非常简单的qt app中进行分段错误

[英]Segmentation fault in a very simple qt app that uses ffmpeg

我对C ++和QT很新,但我确实设置了我的环境来编译和链接ffmpeg(我下载并安装了这个版本“Qt 5.1.1 for Windows 32-bit(MinGW 4.8,OpenGL,666 MB) )“和最新的ffmpeg共享库(FFmpeg 32位共享版本,来自http://ffmpeg.zeranoe.com/builds/的 FFmpeg 32位开发版本)

我有这个简单的应用程序:

#include "frmmain.h"
#include "ui_frmmain.h"


#define __STDC_CONSTANT_MACROS
namespace ffmpeg
{
    extern "C"
    {
        #include <libavcodec/avcodec.h>
        #include <libavformat/avformat.h>
    }
}

frmMain::frmMain(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::frmMain)
{
    ui->setupUi(this);

    ffmpeg::avcodec_register_all();
    ffmpeg::AVFormatContext *pFormatCtx;

    if ((ffmpeg::avformat_open_input(&pFormatCtx,"d:\\1.wmv" , NULL, NULL)) < 0)
    {
        printf("could not open the file");
    }

}

frmMain::~frmMain()
{
    delete ui;
}

构建过程运行没有错误,但如果我调试项目,我得到一个分段错误

如果我运行该项目,它只会在没有任何消息的情况下崩溃。

我有什么想法我做错了吗?

提前致谢

容易一个:)

ffmpeg::AVFormatContext *pFormatCtx = NULL;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM