Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. can't show webcam on Qt 6
Forum Updated to NodeBB v4.3 + New Features

can't show webcam on Qt 6

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 966 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    L4zyM0nday
    wrote on last edited by
    #1

    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

    jsulmJ 1 Reply Last reply
    0
    • L L4zyM0nday

      Yes i did

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #10

      @L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.

      L 1 Reply Last reply
      0
      • L L4zyM0nday

        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

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @L4zyM0nday I doubt these errors have anything to do with camera. How do you access the camera (show your code)?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • L Offline
          L Offline
          L4zyM0nday
          wrote on last edited by
          #3

          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"));

          }
          

          }

          jsulmJ 1 Reply Last reply
          0
          • L L4zyM0nday

            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"));

            }
            

            }

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @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.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • L Offline
              L Offline
              L4zyM0nday
              wrote on last edited by
              #5

              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 ?

              jsulmJ 1 Reply Last reply
              0
              • L L4zyM0nday

                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 ?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @L4zyM0nday said in can't show webcam on Qt 6:

                any solution in this problem ?

                The solution is part of the error message...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  L4zyM0nday
                  wrote on last edited by
                  #7

                  i sorry i have install Gstreamer but still not work, do you have reference about gstreamer for Qt6.6.1 or Qt 5.15

                  jsulmJ 1 Reply Last reply
                  0
                  • L L4zyM0nday

                    i sorry i have install Gstreamer but still not work, do you have reference about gstreamer for Qt6.6.1 or Qt 5.15

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @L4zyM0nday Did you also install "'bad' GStreamer plugin package" just like the error message suggested?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      L4zyM0nday
                      wrote on last edited by
                      #9

                      Yes i did

                      JoeCFDJ 1 Reply Last reply
                      0
                      • L L4zyM0nday

                        Yes i did

                        JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by JoeCFD
                        #10

                        @L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.

                        L 1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @L4zyM0nday I guess qml6gstsink is not available in GStreamer 1.16 and was added from 1.20. You may have to use Qt5.

                          L Offline
                          L Offline
                          L4zyM0nday
                          wrote on last edited by
                          #11

                          @JoeCFD yes my Qt version 5.15

                          1 Reply Last reply
                          0
                          • L L4zyM0nday has marked this topic as solved on

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved