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

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.
  • Pradeep KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by
    #1

    Hi,

    I am working on the Camera streaming , we have the 3 party api, which is providing the stream, the api will provide us the bitmap, my question is?.

    how can we add Bitmap to Qt widgets, should we use Qpainter to draw, or Qlabel to show continuous streams?.

    Suggestions would help me,

    Thanks,

    Pradeep Kumar
    Qt,QML Developer

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

      Hi,

      How does this 3rd party work ?

      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
        #3

        We have certain api's which will provide to initialize , based on the api call callback is called. then we get continous streaming , we have the return result also.

        In the callback we get the data in Bitmap.

        Thanks,

        Pradeep Kumar
        Qt,QML Developer

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

          You could create a QtMultimedia backend for QCamera using these APIs.

          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
            #5

            it is a contiuous live streaming, how can i show in QtMultimedia class?.

            which classes should i use and i need to convert bitmap also then display.

            Thanks,

            Pradeep Kumar
            Qt,QML Developer

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

              Take a look at the plugins sources.

              You can create QImage from Bitmap.

              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
                #7

                K then i need to show the streaming , do i need to use QPainter to show live streaming, because we have drawImage() method, and is my understanding right?.

                u mentioned about plugin sources, where in docs, which topic?.

                Thanks,

                Pradeep Kumar
                Qt,QML Developer

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

                  If you implement a backend for QtMultimedia, you'll use QCamera with a QViewFinder in your application.

                  I mean Qt's sources, directly.

                  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
                    #9

                    after getting the bitmap data , how can i add to Qcamera and QCameraviewfinder?.

                    using 3 party API's can we add the streaming to Qcamera?.

                    Thanks,

                    Pradeep Kumar
                    Qt,QML Developer

                    1 Reply Last reply
                    0
                    • 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