MediaGun / QuickVLC

Vlc and Qt (Qml) integration library
Other
8 stars 2 forks source link

"Stairs" transition between frames for some videos #6

Open aa-bamboo opened 2 years ago

aa-bamboo commented 2 years ago

When a video starts to play or when you go to the specific timestamp, the stairs of pixels appear.

OS: Windows

Screenshot-5 Screenshot-6 Screenshot-8

Test video sample file: File

chubinou commented 2 years ago

Hi, I assume this is due to some issues with your triple-buffering mechanism, mostly because you swap your displayed picture at some point but QML render loop is updated asynchronously, to the displayed picture may be re-written by vlc in the meantime

Hi have some questions regarding your code:

https://github.com/bambooagile/QuickVLC/blob/master/src/qml/video/videostream.cpp#L65

do you require that a frame can be displayed in multiple surfaces

aa-bamboo commented 2 years ago

Thank you for the response.

triple-buffering mechanism, mostly because you swap your displayed picture at some point but QML render loop is updated asynchronously

It's already implemented a flag which allows updating Qml's Node only when buffers have been switched: https://github.com/bambooagile/QuickVLC/blob/master/src/qml/videooutput.cpp#L115 I thought it worked as expected.

Also, strange thing, but I don't have such artifacts on Linux.

do you require that a frame can be displayed in multiple surfaces

It supposed to be. Nice to have it for various scenarios of library integrations.

Do you have suggestions?

chubinou commented 2 years ago

It's already implemented a flag which allows updating Qml's Node only when buffers have been switched:

hum OK, I think you're right. I thought this was a race condition issue due to the rendering happening in a different thread, but the documentation states that:

 The main thread is blocked while this function is executed so it is safe to read values from the QQuickItem

Also, strange thing, but I don't have such artifacts on Linux.

the other hypothesis is crappy OpenGL driver on windows, I don't observe such effect on my windows machine, but I definitely have some tearing

note that I don't see tearing when using VLC desktop with OpenGL output on windows, so this let me think that the issue is rather due to something wrong on the application level.

If this is a driver issue, this would definitely be bad news, as the solution would be to implement the same mechanism but using the D3D callbacks to integrate with Qt6 RHI backend (OpenGL drivers on windows are often subpar compared to D3D driver)