How to remove flickering in video?
Unsolved
General and Desktop
-
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 problemQWidget* 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();
-
From a quick look
VlcMediaListPlayer::setPlaybackMode
is likely what you are looking for.