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. Regarding the live streaming and how to Show it on Widget
Qt 6.11 is out! See what's new in the release blog

Regarding the live streaming and how to Show it on Widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
19 Posts 2 Posters 4.1k Views 2 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #10

    That's what I've been telling you: you can make a custom backend (plugin) for QtMultimedia using that 3rd party API. You'll manipulate the data in the plugin and in your software you'll just create a QCamera using the device(s) provided by your plugin.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • Pradeep KumarP Offline
      Pradeep KumarP Offline
      Pradeep Kumar
      wrote on last edited by
      #11

      Hi,

      I have used QPainter and drawImage() method to draw image on QWidget, i am getting the live streams, populating on to the Widget.

      Thanks,

      Pradeep Kumar
      Qt,QML Developer

      1 Reply Last reply
      0
      • Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by Pradeep Kumar
        #12

        Hi,

        i am using update() method in a slot to call paintevent() . But when using update(), their is a lag in the frames painting on to the widget.

        void MyWidget::getImageBuf(unsigned char* buf)
        {
          
            m_data  = QByteArray((char*)buf, size + 54);
            this->update();
         
        }
        
        void MyWidget::paintEvent(QPaintEvent *)
        {
        
            image->loadFromData(m_data);
        
            QRect rect(m_widget->x(),m_widget->y(),m_widget->width(),m_widget->height());
        
            QPainter painter(this);
            painter.setPen(Qt::SolidLine);
            painter.drawImage(rect,*image,image->rect());
        
        }
        

        i even used repaint() , but the app is crashing. Is their any option to make update() call paintevent frequently as we get the frames.

        Thanks,

        Pradeep Kumar
        Qt,QML Developer

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #13

          You should rather first identify your bottleneck. You might not need quicker painting but quicker loading.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Pradeep KumarP Offline
            Pradeep KumarP Offline
            Pradeep Kumar
            wrote on last edited by
            #14

            Hi,

            checked with the buffer frame rate and paintevent called . the lag was due to update(), as it was not immediately painting on to the widget.

            How can i resolve, any alternative?.

            Thanks,

            Pradeep Kumar
            Qt,QML Developer

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #15

              What frame rate and image size are you supposed to be handling ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • Pradeep KumarP Offline
                Pradeep KumarP Offline
                Pradeep Kumar
                wrote on last edited by
                #16

                hi,

                if we want to have Qt multimedia backend, which classes should we use and we need to customize and then add to the QCameraViewfinder?.

                Thanks,

                Pradeep Kumar
                Qt,QML Developer

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #17

                  Take a look at the QtMultimedia plugins more specifically the camera part.

                  The idea is to create a plugin that will provide the camera related interfaces.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • Pradeep KumarP Offline
                    Pradeep KumarP Offline
                    Pradeep Kumar
                    wrote on last edited by
                    #18

                    How can we do it, do we need to subclass any of the classes?.
                    Is their an example or link for the plugins?.

                    Thanks,

                    Pradeep Kumar
                    Qt,QML Developer

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #19

                      No there's no examples, you have to take a look at Qt's sources.

                      Yes you'll have to do some subclassing, however, the list of the classes to use will depend on what controls you will want to provide. Hence take a look at the sources of one of the cameras implementation.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

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