PDA

View Full Version : Qt - Overlay QGraphicsView over vlc video



m1lhaus
27th June 2013, 16: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 :(

http://forum.videolan.org/viewtopic.php?f=32&t=68816&p=228645

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

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

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

m1lhaus
28th June 2013, 11: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.

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

m1lhaus
28th June 2013, 12: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.

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

http://doc-snapshot.qt-project.org/qt-mobility/qgraphicsvideoitem.html

m1lhaus
28th June 2013, 12: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.

m1lhaus
6th July 2013, 12: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.