簡體   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