[Windows, Qt5, QMediaPlayer, QMediaPlaylist]: Tiny duration black screen when the current video source changed

前端 未结 1 1638
清歌不尽
清歌不尽 2021-01-28 09:53

I\'m writing a Video Player with Qt5::QMediaPlayer to play randomly some videos for a randomly duration as this:

int main(int argc, char *argv[]) {
    QApplica         


        
相关标签:
1条回答
  • 2021-01-28 10:39

    This is a reported bug in QtMediaPlayer and it only occurs on Windows. In current API, when a media reach the end, player clears the video area to play next media. Transition is not seamless and cause invalid frames. As a workaround in a looping video one can change the position to desired frame in same media.

    If you need to change the media you can try using two mediaplayer object one for current media and one for next media. When it is time to play the next media change that player position to 0 and show it on widget. That one is stated in link of bug report. It is messy and still not a complete solution.

    So, What to do?

    1. You can wait for the Qt fix. Bug seems reported 2-3 months ago.

    2. Change Media Player ( Gstreamer has gapless/seamless video support ) You can surely embed a media player in your UI developped with Qt. There are examples.

    3. Move t another UI library that offers better media playing features.

    I would go with the 2-1-3 order. Try embedding another media player and allow a couple of months for them to fix the bug.

    0 讨论(0)
提交回复
热议问题