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. Unable to change video playback speed run-time QMediaplayer QAbstractVideoSurace
Forum Updated to NodeBB v4.3 + New Features

Unable to change video playback speed run-time QMediaplayer QAbstractVideoSurace

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 2 Posters 2.2k 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 SGaist

    Hi,

    That's likely because you call the stop method. You should rather handle the case where the size changes or the format changes.

    Did you check which one it is that is triggering the stop call ?

    M Offline
    M Offline
    magicstar
    wrote on last edited by
    #3

    @SGaist ,
    Yes. removing stop call works as expected. There is one more problem.
    Sometimes, the present method is not called at all. Can you please suggest root cause for the issue?

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

      In what kind of circonstances ?

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

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        In what kind of circonstances ?

        M Offline
        M Offline
        magicstar
        wrote on last edited by
        #5

        @SGaist,
        It is very random. I have cleaned code multiple times and rebuild. But, it still seems random. It does not seem issue of video format as well. Same video file may play sometimes and not play sometimes

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

          Can you see any particular changes in the video frame you receive when that happens ?

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

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you see any particular changes in the video frame you receive when that happens ?

            M Offline
            M Offline
            magicstar
            wrote on last edited by magicstar
            #7

            @SGaist ,
            The video frame is not displayed at all. As present function is not called. So, I do not see any change in videoframe.
            I am not sure why I am facing many problems with above implementation. I have observed few other problems.

            1. If I stop video or reload second video I get read access violation at
              pixmap->setPixmap(QPixmap::fromImage(img));

            2. I am unable to play video at 4x speed. audio and video is not synced at all. Seems like audio gets played at 4x speed and frames get piled up and are being displayed at its own speed.

            I have implemented QAbstractVideoSurface to modify frames on the fly using different OpenCV functions. Currently, I am facing many problems just at the basic implementation. Is there any other better way to achieve the goal ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8
              1. Did you check the stack trace to see what is happening ?
                Are you sure your pixmap is value ?
                Are creating a new VideoFrameGrabber in between ?
              2. What kind of processing are you applying ? These can be time consuming and thus slow down the video pipeline.

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

              M 1 Reply Last reply
              0
              • SGaistS SGaist
                1. Did you check the stack trace to see what is happening ?
                  Are you sure your pixmap is value ?
                  Are creating a new VideoFrameGrabber in between ?
                2. What kind of processing are you applying ? These can be time consuming and thus slow down the video pipeline.
                M Offline
                M Offline
                magicstar
                wrote on last edited by magicstar
                #9

                @SGaist ,

                1. I tried debug problem through stack trace.
                  The read access violation is for QScrollBar::wheelEvent function of file Qt5Widgetsd.
                  I tried disabling QGraphicsView and pixmap event filter by setEnabled(false). But, it did not help.
                  I am not creating new VideoFrameGrabber in between. Also, there is no problem in QImage as i am able to save image.
                2. Currently, I am not applying any processing. Just converting QVideoFrame To QImage
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  Where do you have scrollbars in your application ?
                  What is the input format ?

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

                  M 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Where do you have scrollbars in your application ?
                    What is the input format ?

                    M Offline
                    M Offline
                    magicstar
                    wrote on last edited by
                    #11

                    @SGaist
                    After lot of digging and modying code, I feel the problem is not with the scrollbars. After I stop the media, QGraphicsView *view seems to be deleted and that is why i get access violation error. However, I wonder if resources are deallocated when QAbstractVideoSurface::stop is called?
                    If so, what is the better way of implementing the functionality ?

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

                      It should not...

                      Can you show the stack trace of the crash ?

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

                      M 2 Replies Last reply
                      0
                      • SGaistS SGaist

                        It should not...

                        Can you show the stack trace of the crash ?

                        M Offline
                        M Offline
                        magicstar
                        wrote on last edited by magicstar
                        #13
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • SGaistS SGaist

                          It should not...

                          Can you show the stack trace of the crash ?

                          M Offline
                          M Offline
                          magicstar
                          wrote on last edited by
                          #14

                          @SGaist
                          Stack trace of the crash did help me with the error. Thanks a lot...
                          However, one error still remains. Present function of the QAbstractVideoSurface is not called sometimes. And this behaviour is very random as of now.

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

                            What was it ?

                            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