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. Video loop glitch

Video loop glitch

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 967 Views 3 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.
  • C Offline
    C Offline
    celica
    wrote on last edited by
    #1

    Hi Guys
    My code to loop a background video is below which works fine.
    When it gets to the end of the video and restarts there is a brief black screen before it resumes.
    Is there any way to avoid this?
    I was looking at this thread and it appears it may be a bug.
    https://stackoverflow.com/questions/33472761/windows-qt5-qmediaplayer-qmediaplaylist-tiny-duration-black-screen-when-th

    		QMediaPlaylist *aos_dm = new QMediaPlaylist;
    		QMediaPlaylist *aos_nm = new QMediaPlaylist;
    		aos_nm->addMedia(QUrl::fromLocalFile(QDir::currentPath() + "\\Resources\\videos\\nm_animation_1.mp4"));		
    		aos_nm->setCurrentIndex(0);
    		aos_nm->setPlaybackMode(aos_nm->Loop);
    
    		aos_dm->addMedia(QUrl::fromLocalFile(QDir::currentPath() + "\\Resources\\videos\\dm_animation_1.mp4"));
    		aos_dm->setCurrentIndex(0);
    		aos_dm->setPlaybackMode(aos_dm->Loop);
    
    		player->setPlaylist(aos_dm);
    
    		videoWidget = new QVideoWidget(mstrWnd);
    		player->setVideoOutput(videoWidget);
    		videoWidget->setGeometry(getSettingI(MSTR_APP_X).toInt(),					
    			getSettingI(MSTR_APP_Y).toInt(),										
    			getSettingI(MSTR_APP_WIDTH).toInt(),									
    			getSettingI(MSTR_APP_HEIGHT).toInt());		
    		videoWidget->show();
    		player->play();
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should add:

      • Qt version
      • OS version
      • Video file specification

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

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You should add:

        • Qt version
        • OS version
        • Video file specification
        C Offline
        C Offline
        celica
        wrote on last edited by
        #3

        @SGaist Oh my dev machine is :
        Windows 10
        QT 5.12.2
        Visual Studio 2017
        There are 2 video files, both of MP4 type. (I've tried AVI as well)
        All codecs installed, videos play fine, it is just on the loop restart there is a black screen for 0.5 second

        I've executed the deployed app on a Windows 7 machine with the same outcome.

        C 1 Reply Last reply
        0
        • C celica

          @SGaist Oh my dev machine is :
          Windows 10
          QT 5.12.2
          Visual Studio 2017
          There are 2 video files, both of MP4 type. (I've tried AVI as well)
          All codecs installed, videos play fine, it is just on the loop restart there is a black screen for 0.5 second

          I've executed the deployed app on a Windows 7 machine with the same outcome.

          C Offline
          C Offline
          celica
          wrote on last edited by
          #4

          @celica Hi there, any one ever experience this issue & overcome before

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TomHat
            wrote on last edited by
            #5

            Hello everyone,

            I am actually experiencing the exact same issue, using Qt 5.15.2, on Win 10.
            I have tried with *.webm and *.mp4 videos.
            Tried using both :
            QMediaPlaylist::Loop
            QMediaPlaylist::CurrentItemInLoop

            Both give the same "split second blackout" glitch.

            Hope this helps.

            Regards,

            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