View Full Version : Qt - Overlay QGraphicsView over vlc video

27th June 2013, 15:43
I have some troubles to implement VLC player to my project. I need overlay video with QgraphicsView (basicaly canvas) so I be able to draw things. I've tried to do it this way:

Point winId pointer to QgraphicsView. Video renders just fine, but it renders on top of the object, so my graphics items are under video layer. => fail
Create new QGraphics object as child of my main QGraphics object and then render video to this child. Result is the same as above. => fail
Overlay QWidget with rendered video with my QGraphicsView (same pos and size). I've set transparent background so I can see overlayed widgets but video under this layer just won't render. I stays white but I can hear its playing. => fail

I've read on this forum, that somebody extracts every frame, and sets it as pixmap to an object. I saw the code, but furtunatelly, I don't get it, because I not C++ professional :( I am using Python bindings for Qt (PySide) and for VLC. Please help, it really bothers me :(


28th June 2013, 07:23
Is using VLC for the video a hard requirement?

28th June 2013, 09:28
Sorry, but I don't understand your question.

28th June 2013, 10:28
I'm asking if you can use a different framework for displaying video.

28th June 2013, 10:47
I think we can, but VLC was nice solution because of multiplatform, codes support, etc. What would you suggest? It needs to work at least on Windows and Linux and work with Python.

I just need to display video and be able to draw on it.

28th June 2013, 11:12
I would suggest to use the multimedia module which is part of Qt.

28th June 2013, 11:16
Would I be able to somehow overlay it by QgraphicsView or use it as background for Qgraphicsview and be able to draw things? I need to annotate faces and other things in video by rectangles, circles, etc.

28th June 2013, 11:21
Would I be able to somehow overlay it by QgraphicsView or use it as background for Qgraphicsview and be able to draw things?


28th June 2013, 11:35
Problem is that QGraphicsVideoItem is not available in PySide and PyQt 5.0. But I've found it in PyQt 5.0.1 development snapshot so I can try it.

6th July 2013, 11:45
Lately, I've used integrated Phonon player. It's easy to add Phonon video widget as QGraphicsItem through QGraphicsProxyWidget. Works like a charm with K-Lite codec pack on Windows background.