can't show webcam on Qt 6
-
i have tried my program and I stil have same result
qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't load OpenSsl library
Cannot resolve symbol vaSyncBuffer
qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't resolve VAAPI symbols -
Yes i did
@L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.
-
i have tried my program and I stil have same result
qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't load OpenSsl library
Cannot resolve symbol vaSyncBuffer
qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't resolve VAAPI symbols@L4zyM0nday I doubt these errors have anything to do with camera. How do you access the camera (show your code)?
-
Thank you for your respon. this my program
#include "mainpage.h"
#include "ui_mainpage.h"
#include "mainwindow.h"QStringList id,ip;
QString Data1, Data2;
QString IP1,IP2;MainPage::MainPage(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainPage)
{
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);sizeGrip = new QSizeGrip(ui->frame_6); sizeGrip->setGeometry(ui->frame_6->width() - sizeGrip->width(), ui->frame_6->height() - sizeGrip->height(), sizeGrip->width(),sizeGrip->height()); Qvlcplayer *mediaPlayer1F = new Qvlcplayer(this); mediaPlayer1F->setVideoWidget(ui->CAM1); mMediaPlayer1F = mediaPlayer1F; mMediaPlayer1F->addMedia("v4l2:///dev/video0"); Qvlcplayer *mediaPlayer1FZ = new Qvlcplayer(this); mediaPlayer1FZ->setVideoWidget(ui->CCTV_Zoom); mMediaPlayer1FZ = mediaPlayer1FZ; mMediaPlayer1FZ->addMedia("v4l2:///dev/video0"); Qvlcplayer *mediaPlayer1R = new Qvlcplayer(this); mediaPlayer1R->setVideoWidget(ui->CAM2); mMediaPlayer1R = mediaPlayer1R; mMediaPlayer1R->addMedia("rtsp://admin:Admin123@192.168.10.10/Streaming/Channels/001"); Qvlcplayer *mediaPlayer1RZ = new Qvlcplayer(this); mediaPlayer1RZ->setVideoWidget(ui->CCTV_Zoom); mMediaPlayer1RZ = mediaPlayer1RZ; mMediaPlayer1RZ->addMedia("rtsp://admin:Admin123@192.168.10.10/Streaming/Channels/001"); a1->setText("Minimaze"); a1->setIcon(QIcon(":/Icon/icon/minimize-sign.png")); connect(a1, SIGNAL(triggered()),this, SLOT(showMinimized())); connect(a2, SIGNAL(triggered()),this, SLOT(on_a2_triggered())); if(this->isMaximized()) { a2->setText("Restore"); a2->setIcon(QIcon(":/Icon/icon/maximize (1).png")); }else{ a2->setText("Maximize"); a2->setIcon(QIcon(":/Icon/icon/maximize.png")); } a3->setIcon(QIcon(":/Icon/icon/question.png")); a3->setText("Help"); connect(a3, SIGNAL(triggered()),this, SLOT(on_a3_triggered())); a4->setIcon(QIcon(":/Icon/icon/info.png")); a4->setText("About"); connect(a4, SIGNAL(triggered()),this, SLOT(on_a4_triggered())); a5->setIcon(QIcon(":/Icon/icon/close.png")); a5->setText("Close"); connect(a5, SIGNAL(triggered()),this, SLOT(on_a5_triggered())); QAction *c1 = new QAction(); c1->setText("CCTV1"); connect(c1, SIGNAL(triggered()),this, SLOT(on_c1_triggered())); QMenu *select = new QMenu; select->addAction(c1); QMenu *menu = new QMenu; menu->addAction(a1); menu->addAction(a2); menu->addAction(a3); menu->addAction(a4); menu->addAction(a5); ui->setting1->setMenu(menu); ui->Select->setMenu(select);
}
MainPage::~MainPage()
{
delete ui;
}
void MainPage::mousePressEvent(QMouseEvent *event){
cur_pos = event->globalPosition().toPoint();}
void MainPage::mouseMoveEvent(QMouseEvent *event){
new_pos = QPoint(event->globalPosition().toPoint() - cur_pos);
move(x() + new_pos.x(), y() + new_pos.y());
cur_pos = event->globalPosition().toPoint();
}void MainPage::on_Back_clicked()
{
if(isMaximized())
{
mMediaPlayer1F->stop();
// mMediaPlayer1R->stop();
this->hide();
MainWindow *mainwindow = new MainWindow();
mainwindow->show();
mainwindow->showMaximized();}else{ mMediaPlayer1F->stop(); // mMediaPlayer1R->stop(); this->hide(); MainWindow *mainwindow = new MainWindow(); mainwindow->show(); mainwindow->showNormal(); }
}
void MainPage::on_a3_triggered()
{
QMessageBox::information(this,"Help","Should you have any question ?" "Contact Us (0351)4773030)");
}void MainPage::on_a4_triggered()
{
QMessageBox::question(this,"About Us","GUI CCTV for monitoring system by REKAINDO");
}void MainPage::on_a5_triggered()
{
mMediaPlayer1F->stop();
mMediaPlayer1R->stop();
this->close();
}void MainPage::on_c1_triggered()
{
mMediaPlayer1F->playAt(0);
// mMediaPlayer1R->playAt(0);
}void MainPage::on_Back_Zoom_clicked()
{
ui->Zoom_CCTV->hide();
ui->CCTV_View->showMaximized();
mMediaPlayer1FZ->stop();
// mMediaPlayer1RZ->stop();
}void MainPage::on_Zoom_L_clicked()
{
ui->Zoom_CCTV->show();
ui->CCTV_View->hide();
mMediaPlayer1FZ->playAt(0);}
void MainPage::on_Zoom_R_clicked()
{
ui->Zoom_CCTV->show();
ui->CCTV_View->hide();
// mMediaPlayer1RZ->playAt(0);
}void MainPage::on_a2_triggered()
{
if(isMaximized())
{
showNormal();
a2->setText("Maximize");
a2->setIcon(QIcon(":/Icon/icon/maximize.png"));
}else{
showMaximized();
a2->setText("Restore");
a2->setIcon(QIcon(":/Icon/icon/maximize (1).png"));}
}
-
Thank you for your respon. this my program
#include "mainpage.h"
#include "ui_mainpage.h"
#include "mainwindow.h"QStringList id,ip;
QString Data1, Data2;
QString IP1,IP2;MainPage::MainPage(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainPage)
{
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);sizeGrip = new QSizeGrip(ui->frame_6); sizeGrip->setGeometry(ui->frame_6->width() - sizeGrip->width(), ui->frame_6->height() - sizeGrip->height(), sizeGrip->width(),sizeGrip->height()); Qvlcplayer *mediaPlayer1F = new Qvlcplayer(this); mediaPlayer1F->setVideoWidget(ui->CAM1); mMediaPlayer1F = mediaPlayer1F; mMediaPlayer1F->addMedia("v4l2:///dev/video0"); Qvlcplayer *mediaPlayer1FZ = new Qvlcplayer(this); mediaPlayer1FZ->setVideoWidget(ui->CCTV_Zoom); mMediaPlayer1FZ = mediaPlayer1FZ; mMediaPlayer1FZ->addMedia("v4l2:///dev/video0"); Qvlcplayer *mediaPlayer1R = new Qvlcplayer(this); mediaPlayer1R->setVideoWidget(ui->CAM2); mMediaPlayer1R = mediaPlayer1R; mMediaPlayer1R->addMedia("rtsp://admin:Admin123@192.168.10.10/Streaming/Channels/001"); Qvlcplayer *mediaPlayer1RZ = new Qvlcplayer(this); mediaPlayer1RZ->setVideoWidget(ui->CCTV_Zoom); mMediaPlayer1RZ = mediaPlayer1RZ; mMediaPlayer1RZ->addMedia("rtsp://admin:Admin123@192.168.10.10/Streaming/Channels/001"); a1->setText("Minimaze"); a1->setIcon(QIcon(":/Icon/icon/minimize-sign.png")); connect(a1, SIGNAL(triggered()),this, SLOT(showMinimized())); connect(a2, SIGNAL(triggered()),this, SLOT(on_a2_triggered())); if(this->isMaximized()) { a2->setText("Restore"); a2->setIcon(QIcon(":/Icon/icon/maximize (1).png")); }else{ a2->setText("Maximize"); a2->setIcon(QIcon(":/Icon/icon/maximize.png")); } a3->setIcon(QIcon(":/Icon/icon/question.png")); a3->setText("Help"); connect(a3, SIGNAL(triggered()),this, SLOT(on_a3_triggered())); a4->setIcon(QIcon(":/Icon/icon/info.png")); a4->setText("About"); connect(a4, SIGNAL(triggered()),this, SLOT(on_a4_triggered())); a5->setIcon(QIcon(":/Icon/icon/close.png")); a5->setText("Close"); connect(a5, SIGNAL(triggered()),this, SLOT(on_a5_triggered())); QAction *c1 = new QAction(); c1->setText("CCTV1"); connect(c1, SIGNAL(triggered()),this, SLOT(on_c1_triggered())); QMenu *select = new QMenu; select->addAction(c1); QMenu *menu = new QMenu; menu->addAction(a1); menu->addAction(a2); menu->addAction(a3); menu->addAction(a4); menu->addAction(a5); ui->setting1->setMenu(menu); ui->Select->setMenu(select);
}
MainPage::~MainPage()
{
delete ui;
}
void MainPage::mousePressEvent(QMouseEvent *event){
cur_pos = event->globalPosition().toPoint();}
void MainPage::mouseMoveEvent(QMouseEvent *event){
new_pos = QPoint(event->globalPosition().toPoint() - cur_pos);
move(x() + new_pos.x(), y() + new_pos.y());
cur_pos = event->globalPosition().toPoint();
}void MainPage::on_Back_clicked()
{
if(isMaximized())
{
mMediaPlayer1F->stop();
// mMediaPlayer1R->stop();
this->hide();
MainWindow *mainwindow = new MainWindow();
mainwindow->show();
mainwindow->showMaximized();}else{ mMediaPlayer1F->stop(); // mMediaPlayer1R->stop(); this->hide(); MainWindow *mainwindow = new MainWindow(); mainwindow->show(); mainwindow->showNormal(); }
}
void MainPage::on_a3_triggered()
{
QMessageBox::information(this,"Help","Should you have any question ?" "Contact Us (0351)4773030)");
}void MainPage::on_a4_triggered()
{
QMessageBox::question(this,"About Us","GUI CCTV for monitoring system by REKAINDO");
}void MainPage::on_a5_triggered()
{
mMediaPlayer1F->stop();
mMediaPlayer1R->stop();
this->close();
}void MainPage::on_c1_triggered()
{
mMediaPlayer1F->playAt(0);
// mMediaPlayer1R->playAt(0);
}void MainPage::on_Back_Zoom_clicked()
{
ui->Zoom_CCTV->hide();
ui->CCTV_View->showMaximized();
mMediaPlayer1FZ->stop();
// mMediaPlayer1RZ->stop();
}void MainPage::on_Zoom_L_clicked()
{
ui->Zoom_CCTV->show();
ui->CCTV_View->hide();
mMediaPlayer1FZ->playAt(0);}
void MainPage::on_Zoom_R_clicked()
{
ui->Zoom_CCTV->show();
ui->CCTV_View->hide();
// mMediaPlayer1RZ->playAt(0);
}void MainPage::on_a2_triggered()
{
if(isMaximized())
{
showNormal();
a2->setText("Maximize");
a2->setIcon(QIcon(":/Icon/icon/maximize.png"));
}else{
showMaximized();
a2->setText("Restore");
a2->setIcon(QIcon(":/Icon/icon/maximize (1).png"));}
}
@L4zyM0nday said in can't show webcam on Qt 6:
Qvlcplayer
You're using an external library which is not part of Qt. You can also ask whomever is working on this library.
As far as I can see you have no error handling - something a well written application must have.
Also, please reduce your code to a minimal reproducible example without all this unnecessary code. -
i try another program and i another issue in ubuntu 20.0.6
"VirtualBox Webcam - Integrated "
Error: cannot create camera service, the 'camerabin' plugin is missing for GStreamer 1.16.
Please install the 'bad' GStreamer plugin package.
any solution in this problem ? -
i try another program and i another issue in ubuntu 20.0.6
"VirtualBox Webcam - Integrated "
Error: cannot create camera service, the 'camerabin' plugin is missing for GStreamer 1.16.
Please install the 'bad' GStreamer plugin package.
any solution in this problem ?@L4zyM0nday said in can't show webcam on Qt 6:
any solution in this problem ?
The solution is part of the error message...
-
i sorry i have install Gstreamer but still not work, do you have reference about gstreamer for Qt6.6.1 or Qt 5.15
-
i sorry i have install Gstreamer but still not work, do you have reference about gstreamer for Qt6.6.1 or Qt 5.15
@L4zyM0nday Did you also install "'bad' GStreamer plugin package" just like the error message suggested?
-
Yes i did
-
Yes i did
@L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.
-
@L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.
@JoeCFD yes my Qt version 5.15
-