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. QMediaPlayer Seek to a position before playing video
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer Seek to a position before playing video

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 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.
  • M Offline
    M Offline
    magicstar
    wrote on last edited by
    #1

    I want to seek to a position when video is paused and played again.
    I have added below code to set position and play media

    player->setPosition(pos);
    player->play();
    

    However, it would show first frame before seeking to new position.
    For e.g. I paused video at 100 ms. Now when I set position to 150 ms, first 100 ms frame will be displayed before continuing video smoothly from 150 ms.
    Is there any way, I avoid displaying frame at 100 ms ?

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

      Hi,

      What version of Qt ?
      What platform are you running on ?
      What type of video ?

      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

        Hi,

        What version of Qt ?
        What platform are you running on ?
        What type of video ?

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

        @SGaist ,

        Qt version 5.12 with MSVC 2017
        Platform : Windows
        any kind of video . e.g .avi, .mp4

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

          Can you check which multimedia backend is loaded ?

          For that, set the QT_DEBUG_PLUGINS environment variable to 1 in the Run part of the Project panel.

          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 check which multimedia backend is loaded ?

            For that, set the QT_DEBUG_PLUGINS environment variable to 1 in the Run part of the Project panel.

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

            @SGaist said in QMediaPlayer Seek to a position before playing video:

            QT_DEBUG_PLUGIN

            This is the log I get after following above procedure

            QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/plugins/mediaservice/dsengine.dll"
            Found metadata in lib C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/plugins/mediaservice/dsengine.dll, metadata=
            {
                "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
                "MetaData": {
                    "Keys": [
                        "directshow"
                    ],
                    "Services": [
                        "org.qt-project.qt.camera",
                        "org.qt-project.qt.mediaplayer"
                    ]
                },
                "archreq": 0,
                "className": "DSServicePlugin",
                "debug": false,
                "version": 330752
            }
            
            
            Got keys from plugin meta data ("directshow")
            QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/plugins/mediaservice/dsengined.dll"
            Found metadata in lib C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/plugins/mediaservice/dsengined.dll, metadata=
            {
                "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
                "MetaData": {
                    "Keys": [
                        "directshow"
                    ],
                    "Services": [
                        "org.qt-project.qt.camera",
                        "org.qt-project.qt.mediaplayer"
                    ]
                },
                "archreq": 1,
                "className": "DSServicePlugin",
                "debug": true,
                "version": 330752
            }
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              From a quick look at the code, I would say that the behaviour is normal (although not what you'd want) with regard to how it's implemented.

              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

                From a quick look at the code, I would say that the behaviour is normal (although not what you'd want) with regard to how it's implemented.

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

                @SGaist

                is there any other way to achieve expected behaviour ?

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

                  You would likely have to fiddle with the backend code.

                  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