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. How to remove flickering in video?
Qt 6.11 is out! See what's new in the release blog

How to remove flickering in video?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.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.
  • BREEZE_KOB Offline
    BREEZE_KOB Offline
    BREEZE_KO
    wrote on last edited by
    #1

    I am playing QMediaPlaylist continuously with QMediaPlayer.
    But there is an unnatural (flicker) between the end of the video and the start of the next.
    How can I solve the problem

        QWidget* mainWidget = new QWidget(this);
        this->setCentralWidget(mainWidget);
        mainWidget->setStyleSheet("background-color: black;");
        QVBoxLayout* mainLayout = new QVBoxLayout;
        mainLayout->setMargin(0);
        mainLayout->setSpacing(0);
        mainWidget->setLayout(mainLayout);
    
        m_mediaPlayer = new QMediaPlayer;
        m_playlist = new QMediaPlaylist;
        m_playlist->setPlaybackMode(QMediaPlaylist::CurrentItemInLoop);
        m_mediaPlayer->setPlaylist(m_playlist);
    
        QVideoWidget *videoWidget = new QVideoWidget;
        mainLayout->addWidget(videoWidget);
    
        m_mediaPlayer->setVideoOutput(videoWidget);
    
        QStringList filenames = QFileDialog::getOpenFileNames(
                    this,
                    tr("Video files"),
                    QDir::currentPath(),
                    tr("mp4 files (*.mp4);avi files (*.avi);All files (*.*)")
        );
    
        if( !filenames.isEmpty() )
        {
            for (int i =0;i<filenames.count();i++)
            {
                m_playlist->addMedia(QUrl::fromLocalFile(filenames.at(i)));
            }
    
        }
        m_mediaPlayer->play();
        this->showFullScreen();
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Depending on your end goal, you might want to consider something like VLC-Qt.

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

      BREEZE_KOB 1 Reply Last reply
      0
      • BREEZE_KOB Offline
        BREEZE_KOB Offline
        BREEZE_KO
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Depending on your end goal, you might want to consider something like VLC-Qt.

          BREEZE_KOB Offline
          BREEZE_KOB Offline
          BREEZE_KO
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            From a quick look VlcMediaListPlayer::setPlaybackModeis likely what you are looking for.

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

            BREEZE_KOB 1 Reply Last reply
            0
            • SGaistS SGaist

              From a quick look VlcMediaListPlayer::setPlaybackModeis likely what you are looking for.

              BREEZE_KOB Offline
              BREEZE_KOB Offline
              BREEZE_KO
              wrote on last edited by
              #6

              @SGaist Thank you :)

              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