更新代码

This commit is contained in:
feiyangqingyun
2023-01-30 11:41:50 +08:00
parent 890c06d443
commit d35ca11ee2
30 changed files with 85 additions and 68 deletions

View File

@@ -253,7 +253,7 @@ void FFmpegThread::run()
continue;
}
frameFinish = avcodec_receive_frame(videoCodec, avFrame2);
frameFinish = avcodec_receive_frame(videoCodec, avFrame2);
if (frameFinish < 0) {
continue;
}
@@ -383,7 +383,16 @@ void FFmpegWidget::paintEvent(QPaintEvent *)
//qDebug() << TIMEMS << "paintEvent" << objectName();
QPainter painter(this);
#if 0
//image = image.scaled(this->size(), Qt::KeepAspectRatio);
//按照比例自动居中绘制
int pixX = rect().center().x() - image.width() / 2;
int pixY = rect().center().y() - image.height() / 2;
QPoint point(pixX, pixY);
painter.drawImage(point, image);
#else
painter.drawImage(this->rect(), image);
#endif
}
void FFmpegWidget::updateImage(const QImage &image)

View File

@@ -1,7 +1,7 @@
### 特别说明
1. 编译完成以后记得将动态库文件复制到可执行文件同一目录。
2. 动态库地址:[https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA](https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA) 提取码: ujm7
3. 收费增强版:[https://qtchina.blog.csdn.net/article/details/103946731](https://qtchina.blog.csdn.net/article/details/103946731)
3. 收费增强版:[https://qtchina.blog.csdn.net/article/details/103946067](https://qtchina.blog.csdn.net/article/details/103946067)
### 其他说明
1. 作品大全:[https://qtchina.blog.csdn.net/article/details/97565652](https://qtchina.blog.csdn.net/article/details/97565652)

View File

@@ -7,7 +7,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
ui->setupUi(this);
QStringList urls;
urls << "https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8";
urls << "f:/1.mp4";
urls << "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov";
urls << "http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4";
urls << "rtsp://admin:Admin123456@192.168.0.15:554/media/video1";