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. QVideoWidget vs QGraphicsVideoItem
Forum Updated to NodeBB v4.3 + New Features

QVideoWidget vs QGraphicsVideoItem

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 4 Posters 11.6k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 15 Jul 2017, 20:45 last edited by
    #8

    Which version of 5.9 ?

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

    Z 1 Reply Last reply 16 Jul 2017, 09:43
    0
    • S SGaist
      15 Jul 2017, 20:45

      Which version of 5.9 ?

      Z Offline
      Z Offline
      zahi.mashael
      wrote on 16 Jul 2017, 09:43 last edited by
      #9

      @SGaist
      I use Qt 5.9.1 MSVC 2015, 32 bit and MinGW32 bit - Open Source (LGPLv3).

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuzulis
        Qt Champions 2020
        wrote on 23 Jul 2017, 12:21 last edited by
        #10

        QtMM has a lot of issues, it sucks. You can try to use libVLC, ffmpeg or to use DirectShow directly (of course, if a Windows is your main platform).

        Z 1 Reply Last reply 2 Aug 2017, 07:32
        1
        • K kuzulis
          23 Jul 2017, 12:21

          QtMM has a lot of issues, it sucks. You can try to use libVLC, ffmpeg or to use DirectShow directly (of course, if a Windows is your main platform).

          Z Offline
          Z Offline
          zahi.mashael
          wrote on 2 Aug 2017, 07:32 last edited by
          #11

          @kuzulis
          Thanks for response.
          I have tried libVLC with QWidget and it works very well. But is there is a possibility to use it in QGraphicsScene?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuzulis
            Qt Champions 2020
            wrote on 2 Aug 2017, 07:38 last edited by
            #12

            @zahi.mashael said in QVideoWidget vs QGraphicsVideoItem:

            But is there is a possibility to use it in QGraphicsScene?

            I don't know.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 2 Aug 2017, 21:14 last edited by
              #13

              The VLC-Qt project provides integration with Qt so you should be able to use QGraphicsWidgetProxy.

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

              G 1 Reply Last reply 7 Aug 2017, 23:17
              1
              • Z Offline
                Z Offline
                zahi.mashael
                wrote on 4 Aug 2017, 12:05 last edited by zahi.mashael 8 Jun 2017, 09:36
                #14

                I tried to use VLC-Qt with QGraphicsProxyWidget class, but just sound is played not the video. Another peaple have already posted a similar problem with QVideoWidget like here.

                I found now a solution for me with QtAV that uses ffmpeg. QtAV contains the class GraphicsItemRenderer that is a sub class of QGraphicsObject. So objects of GraphicsItemRenderer can be added directly to QGraphicsScene. Here is some code that demonstrate this (QtAV must be firstly installed in Qt, see installation instruction):

                #include <QApplication>
                #include <QtAVWidgets>
                #include <QtAV>
                #include <QGraphicsView>
                
                using namespace QtAV;
                
                int main(int argc, char *argv[])
                {
                   QApplication a(argc, argv);
                
                   AVPlayer player;
                
                   GraphicsItemRenderer *item = new GraphicsItemRenderer;
                   item->resizeRenderer(640, 360);
                   item->setOutAspectRatioMode(VideoRenderer::VideoAspectRatio);
                   player.setRenderer(item);
                   QGraphicsScene *scene = new QGraphicsScene;
                   scene->addItem(item);
                   QGraphicsView *view = new QGraphicsView(scene);
                   view->show();
                   player.play("C:/path/to/file.mp4");
                   return a.exec();
                }
                

                QtAV also have a qml integration, so I have now the freedom to choose between QGraphicsView or QtQuick.

                I would like to thanks all very much for the tips. It was a great help.

                1 Reply Last reply
                0
                • S SGaist
                  2 Aug 2017, 21:14

                  The VLC-Qt project provides integration with Qt so you should be able to use QGraphicsWidgetProxy.

                  G Offline
                  G Offline
                  goldstar2154
                  wrote on 7 Aug 2017, 23:17 last edited by
                  #15

                  @SGaist said in QVideoWidget vs QGraphicsVideoItem:

                  The VLC-Qt project provides integration with Qt so you should be able to use QGraphicsWidgetProxy.

                  Unfortunatelly Qt-vlc does not support embedding into QGraphicsScene by issue
                  https://github.com/vlc-qt/vlc-qt/issues/129

                  @zahi-mashael , is QtAv good solution? can you pls say about performance during playing fullHD(1920x1080x60fps) video?
                  I have a big troubles with QVideoWidget when it using like background video-player into QGraphicsScene, fps less than 5, it's horrible)

                  Z 2 Replies Last reply 10 Aug 2017, 15:09
                  0
                  • G goldstar2154
                    7 Aug 2017, 23:17

                    @SGaist said in QVideoWidget vs QGraphicsVideoItem:

                    The VLC-Qt project provides integration with Qt so you should be able to use QGraphicsWidgetProxy.

                    Unfortunatelly Qt-vlc does not support embedding into QGraphicsScene by issue
                    https://github.com/vlc-qt/vlc-qt/issues/129

                    @zahi-mashael , is QtAv good solution? can you pls say about performance during playing fullHD(1920x1080x60fps) video?
                    I have a big troubles with QVideoWidget when it using like background video-player into QGraphicsScene, fps less than 5, it's horrible)

                    Z Offline
                    Z Offline
                    zahi.mashael
                    wrote on 10 Aug 2017, 15:09 last edited by zahi.mashael 8 Oct 2017, 19:37
                    #16

                    @goldstar2154 Yes, it seems so. I played a mp4 file in Full HD, a file about 64 MB big with 2.5 minutes length, and it worked.

                    1 Reply Last reply
                    0
                    • G goldstar2154
                      7 Aug 2017, 23:17

                      @SGaist said in QVideoWidget vs QGraphicsVideoItem:

                      The VLC-Qt project provides integration with Qt so you should be able to use QGraphicsWidgetProxy.

                      Unfortunatelly Qt-vlc does not support embedding into QGraphicsScene by issue
                      https://github.com/vlc-qt/vlc-qt/issues/129

                      @zahi-mashael , is QtAv good solution? can you pls say about performance during playing fullHD(1920x1080x60fps) video?
                      I have a big troubles with QVideoWidget when it using like background video-player into QGraphicsScene, fps less than 5, it's horrible)

                      Z Offline
                      Z Offline
                      zahi.mashael
                      wrote on 17 Aug 2017, 15:51 last edited by
                      #17

                      @goldstar2154 OK, I compared QtAV to vlc with many videos, and vlc always plays videos even better than QtAV. QtAV plays full HD videos especially in qml or as an QGraphicsItem (GraphicsItemRenderer) choppy. In vlc playing video is perfectly smooth.
                      I am not an expert in ffmpeg and QtAV, and there are certainly some options that can be set to improve the performance and quality of the rendering.
                      I am trying now to use vlc in qtquick...

                      G 1 Reply Last reply 18 Aug 2017, 12:39
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 17 Aug 2017, 22:10 last edited by
                        #18

                        Again, the VLC-Qt project might interest you, They provide QML components.

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

                        Z 1 Reply Last reply 18 Aug 2017, 07:15
                        0
                        • S SGaist
                          17 Aug 2017, 22:10

                          Again, the VLC-Qt project might interest you, They provide QML components.

                          Z Offline
                          Z Offline
                          zahi.mashael
                          wrote on 18 Aug 2017, 07:15 last edited by
                          #19

                          @SGaist Yes. I am now working with it.

                          1 Reply Last reply
                          0
                          • Z zahi.mashael
                            17 Aug 2017, 15:51

                            @goldstar2154 OK, I compared QtAV to vlc with many videos, and vlc always plays videos even better than QtAV. QtAV plays full HD videos especially in qml or as an QGraphicsItem (GraphicsItemRenderer) choppy. In vlc playing video is perfectly smooth.
                            I am not an expert in ffmpeg and QtAV, and there are certainly some options that can be set to improve the performance and quality of the rendering.
                            I am trying now to use vlc in qtquick...

                            G Offline
                            G Offline
                            goldstar2154
                            wrote on 18 Aug 2017, 12:39 last edited by
                            #20

                            @zahi.mashael Qt-Av provide qml components too, if you have time can you please compare Qt-av & Qt-vlc qml components? it will be interesting.

                            Z 1 Reply Last reply 19 Aug 2017, 20:06
                            0
                            • G goldstar2154
                              18 Aug 2017, 12:39

                              @zahi.mashael Qt-Av provide qml components too, if you have time can you please compare Qt-av & Qt-vlc qml components? it will be interesting.

                              Z Offline
                              Z Offline
                              zahi.mashael
                              wrote on 19 Aug 2017, 20:06 last edited by zahi.mashael
                              #21

                              @goldstar2154 I have already compared the two components and VLC-Qt qml is in my opinion better. I tested with a video that was created in adobe (1920x1080x30fps) with some move animations and movements""stutter" more with QtAV than with VLC-Qt.

                              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