Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Video stops after seek()

Video stops after seek()

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 2 Posters 822 Views
  • 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
    Melle_87
    wrote on last edited by
    #1

    Hi all,
    If I use seek() to change the position of a video, the video position is changed, but the video is not playing.
    Does anyone know this problem and has a solution?

    Kind regards,
    Melle_87

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

      Hi,

      Which version of Qt are you using ?
      On which platform ?
      Did you try to call play after seeking ?
      Are you seeking while the media is playing ?
      How are you triggering the seek ?

      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
      1
      • SGaistS SGaist

        Hi,

        Which version of Qt are you using ?
        On which platform ?
        Did you try to call play after seeking ?
        Are you seeking while the media is playing ?
        How are you triggering the seek ?

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

        @SGaist:

        • Qt 5.12.4
        • Raspberry pi + Raspbian buster
        • Yes, I call play() after seek(). (But it should not be necessary I think ...)
        • Yes, I am seeking while media is playing.
        • Seek is triggered through slider onMoved.

        After calling seek() I can see that video position has changed. But the video is not running. Video position does not increment.

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

          Does it happen with a specific file or all videos in general ?

          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

            Does it happen with a specific file or all videos in general ?

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

            @SGaist: It happens with all videos. I tried mp4 and avi.

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

              Can you show the code related to that ?

              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

                Can you show the code related to that ?

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

                @SGaist: Yes, of course.

                ...
                VideoOutput {
                	anchors.top: middleVideo.top
                	anchors.left: middleVideo.left
                	anchors.right: middleVideo.right
                	anchors.bottom: playPauseButton.top
                	anchors.margins: 15
                	source: media
                	onVisibleChanged: {
                		if (visible) {
                			media.play()
                		}
                		else {
                			media.stop()
                		}
                	}
                }
                MediaPlayer {
                	id: media
                	autoLoad: true
                	autoPlay: true
                	onStatusChanged: {
                		if (status == MediaPlayer.EndOfMedia) {
                			internShow = def_SHOW_LISTS
                			media.source = ""
                		}
                	}
                }
                ...
                Slider {
                	id: slider
                	anchors.left: playPauseButton.right
                	anchors.leftMargin: 50
                	anchors.right: duration.left
                	anchors.rightMargin: 50
                	anchors.bottom: parent.bottom
                	anchors.bottomMargin: 0
                	height:30
                	from: 0
                	to: media.duration
                	value: media.position
                	stepSize: 1
                	onMoved: {                    
                		media.seek((parseInt(value/1000))*1000)
                	}
                }
                ...
                
                1 Reply Last reply
                0
                • SGaistS SGaist

                  Can you show the code related to that ?

                  M Offline
                  M Offline
                  Melle_87
                  wrote on last edited by Melle_87
                  #8

                  @SGaist: I posted my code some days ago. Do you have any ideas?

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

                    @Melle_87 said in Video stops after seek():

                    media.seek((parseInt(value/1000))*1000)

                    Did you check the value you get there ?

                    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

                      @Melle_87 said in Video stops after seek():

                      media.seek((parseInt(value/1000))*1000)

                      Did you check the value you get there ?

                      M Offline
                      M Offline
                      Melle_87
                      wrote on last edited by
                      #10

                      @SGaist : Yes, of course. The value is okay and is in range.

                      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