Compare commits
1 Commits
push_strea
...
42
Author | SHA1 | Date | |
---|---|---|---|
bd4d055129 |
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
std::cout<<"ximeaAirborneSystem 版本:"<< "41." <<std::endl;
|
std::cout<<"ximeaAirborneSystem 版本:"<< "42." <<std::endl;
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
//UdpServer* x=new UdpServer();
|
//UdpServer* x=new UdpServer();
|
||||||
|
@ -1246,17 +1246,17 @@ void PushFlow::encodePushFlow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 打开输出文件
|
// 打开输出文件
|
||||||
if (avio_open(&formatContext->pb, outputVideoPath, AVIO_FLAG_WRITE) < 0)
|
// if (avio_open(&formatContext->pb, outputVideoPath, AVIO_FLAG_WRITE) < 0)
|
||||||
{
|
// {
|
||||||
qDebug() << "Error: Failed to open output file";
|
// qDebug() << "Error: Failed to open output file";
|
||||||
avcodec_close(codecContext);
|
// avcodec_close(codecContext);
|
||||||
avcodec_free_context(&codecContext);
|
// avcodec_free_context(&codecContext);
|
||||||
avformat_free_context(formatContext);
|
// avformat_free_context(formatContext);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 写入文件头
|
// 写入文件头
|
||||||
avformat_write_header(formatContext, nullptr);
|
// avformat_write_header(formatContext, nullptr);
|
||||||
|
|
||||||
// 使用sws_scale进行颜色空间转换
|
// 使用sws_scale进行颜色空间转换
|
||||||
SwsContext* swsContext = sws_getContext(m_iWidth, m_iHeight, AV_PIX_FMT_BGR24,
|
SwsContext* swsContext = sws_getContext(m_iWidth, m_iHeight, AV_PIX_FMT_BGR24,
|
||||||
@ -1345,7 +1345,7 @@ void PushFlow::encodePushFlow()
|
|||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
// 写入文件尾
|
// 写入文件尾
|
||||||
av_write_trailer(formatContext);
|
// av_write_trailer(formatContext);
|
||||||
|
|
||||||
// 释放AVFrame和相关资源
|
// 释放AVFrame和相关资源
|
||||||
av_freep(&frame->data[0]);
|
av_freep(&frame->data[0]);
|
||||||
|
Reference in New Issue
Block a user