QVideoWidget flickers during pan/zoom :- disable update ?



  • I've implemented the pan/zoom of a QVideoWidget, by sub-classing and controlling the pan by changing the widget's position (using move(QPoint) ) and adjusting the zoom by changing the widget's size. Since I want to zoom with a particular point in the video stationary, I adjust both the size and the position using setGeometry(QRect).

    However, some internals within the QVideoWidget, which is probably quite messy, causes the position change to be updated first, then the size change is applied afterwards, resulting in some unpalatable flickering while zooming in and out. When playing the video with a slow frame rate, you can see that the position change happens immediately, wheras the size change happens when the next frame occurs.

    This could be a bug I suppose ? Note that this flickering is not a problem with the QGraphicsView/QGraphicsVideoItem (but that replayRate control IS a problem - which is why I've reverted to the QVideoWidget :-( )

    Since I don't imagine I would be able to fix the QVideoWidget class, here comes the question - is there a way to disable/enable updates ? This might be explicit for the VideoWidget, or just a general mechanism for QWidgets in general.

    Though, I'm now thinking this won't help, since the size change on next frame issue will still occur. Having said that, it might help (a) when the video is paused (which is a much more likely use case) or (b) if the updates are enable after 1 frame period and the next frame is ready in the buffers for display.

    TIA



  • setUpdatesEnabled(false) for QVideoWidget;



  • Thanks timb - I'll take a lok at this next time I'm in the code. I'm not sure why I didn't find this function before...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.