From bd4d05512970cab054f68748a406a1797a14ae71 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Fri, 1 Mar 2024 10:06:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E8=A7=A3=E5=86=B3bug=EF=BC=9A?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E4=BB=AA=E5=99=A8=E4=BD=BF=E7=94=A8avio=5Fop?= =?UTF-8?q?en/av=5Fwrite=5Fframe=E5=B0=86=E8=A7=86=E9=A2=91=E5=86=99?= =?UTF-8?q?=E5=85=A5=E6=96=87=E4=BB=B6=E4=BC=9A=E5=B4=A9=E6=BA=83=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E4=B8=94=E5=86=99=E5=85=A5=E7=9A=84=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=92=AD=E6=94=BE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source_Files/main.cpp | 2 +- Source_Files/ximeaimager.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source_Files/main.cpp b/Source_Files/main.cpp index 70181f3..cd71b93 100644 --- a/Source_Files/main.cpp +++ b/Source_Files/main.cpp @@ -3,7 +3,7 @@ int main(int argc, char *argv[]) { - std::cout<<"ximeaAirborneSystem 版本:"<< "41." <pb, outputVideoPath, AVIO_FLAG_WRITE) < 0) - { - qDebug() << "Error: Failed to open output file"; - avcodec_close(codecContext); - avcodec_free_context(&codecContext); - avformat_free_context(formatContext); - return; - } +// if (avio_open(&formatContext->pb, outputVideoPath, AVIO_FLAG_WRITE) < 0) +// { +// qDebug() << "Error: Failed to open output file"; +// avcodec_close(codecContext); +// avcodec_free_context(&codecContext); +// avformat_free_context(formatContext); +// return; +// } // 写入文件头 - avformat_write_header(formatContext, nullptr); +// avformat_write_header(formatContext, nullptr); // 使用sws_scale进行颜色空间转换 SwsContext* swsContext = sws_getContext(m_iWidth, m_iHeight, AV_PIX_FMT_BGR24, @@ -1345,7 +1345,7 @@ void PushFlow::encodePushFlow() fclose(fp); // 写入文件尾 - av_write_trailer(formatContext); +// av_write_trailer(formatContext); // 释放AVFrame和相关资源 av_freep(&frame->data[0]);