Issues playing video with QMediaPlayer

Discuss anything related to product development
Post Reply
Paul
Posts: 4
Joined: Mon Jul 25 2022 4:31 pm

Issues playing video with QMediaPlayer

Post by Paul »

Hi,

I am currently trying to develop an application to play a video but I'm having some issues with QMediaPlayer and its behaviour.
What my application should do is as following:
- Load media/playlist
- Start video
- Play it for 10s
- Stop it
- Clear the playlist
- Wait for 5s
- Start again indefinitely

I developed all this using a QMediaPlayer, with QMediaPlaylist, on a QGraphicsVideoItem, and with timers to handle playing/pause duration. I listen to different kind of signals such as positionChanged, stateChanged, mediaStatusChanged...

The first time I play the video, it loads fine and plays fine. But I noticed when it stops and tries to clear the playlist, I don't receive all the events I expect to receive:
- After calling stop, mediaStatusChanged says media is loaded: expected behaviour as the player is stopped.
- After clearing the playlist, I don't receive any event from mediaStatusChanged and mediaStatus stays as loaded whereas the playlist is empty. In this case, I was expecting a NoMedia event in mediaStatusChanged, is that right?
Then, if I keep going, the player will start playing but it will not play anything...

Also, it might or might not be related, but I noticed that if I do not call setVideoOutput, then I don't see the issue above but I can see the position being updated and the different mediaStatus events. I also don't have any video on screen but this was expected for the test :lol:

Did you already hear about this kind of issue? Do you have any idea on how to fix this?

I hope it's clear enough, let me know if it needs more details.

Best regards,
Paul
barbara
Posts: 447
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Issues playing video with QMediaPlayer

Post by barbara »

We have a few questions.

1  What platform (OS and version) are you using?

2  Did you build CopperSpice from source? If so, from what sha? If you are using one of our pre-built binaries, which version?

3  What tool chain are you using? compiler and version, cmake version, etc
But I noticed when it stops and tries to clear the playlist, I don't receive all the events I expect
4  Can you create a very small code sample which shows this issue? Then post a link to the source code.

Barbara
Paul
Posts: 4
Joined: Mon Jul 25 2022 4:31 pm

Re: Issues playing video with QMediaPlayer

Post by Paul »

Hi Barbara,

Thank you for your message! And sorry for the late answer, I was in holidays.
barbara wrote: 1  What platform (OS and version) are you using?
I reproduced the issue on Ubuntu 20.04.
barbara wrote: 2  Did you build CopperSpice from source? If so, from what sha? If you are using one of our pre-built binaries, which version?
I used pre-built binaries from github. It was Copperspice v1.7.4: copperspice-1.7.4-ubuntu20.04-x64.tar.bz2.
barbara wrote: 3  What tool chain are you using? compiler and version, cmake version, etc
I'm using g++ v9.4.0 and CMake v3.16.3.
barbara wrote: 4  Can you create a very small code sample which shows this issue? Then post a link to the source code.
Here is the link to a sample application: [EDIT] https://www.dropbox.com/sh/47306fzlrtr3si6/AAA0mL9tybh-Xqq3SHT7FHjqa?dl=0
As I said in my first message, playing the video the first time works fine. But after I clear the media playlist, media doesn't seem to load properly ever again.

I hope it helps. Let me know if you need anything else.

Best regards,
Paul
Last edited by Paul on Wed Aug 24 2022 7:24 am, edited 1 time in total.
barbara
Posts: 447
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Issues playing video with QMediaPlayer

Post by barbara »

Can you move this to something like Google Drive or Drop Box. The site you are using requires a license agreement.

Barbara
Paul
Posts: 4
Joined: Mon Jul 25 2022 4:31 pm

Re: Issues playing video with QMediaPlayer

Post by Paul »

Hi,

Here is a Dropbox link: https://www.dropbox.com/sh/47306fzlrtr3si6/AAA0mL9tybh-Xqq3SHT7FHjqa?dl=0
I also edited my previous message with this link.

Best regards,
Paul
Paul
Posts: 4
Joined: Mon Jul 25 2022 4:31 pm

Re: Issues playing video with QMediaPlayer

Post by Paul »

Hi,

Did anyone have similar issues with QMediaPlayer?
Or does anyone have an idea on how to fix this please?

Thanks
Post Reply