我有一些麻烦,以实现VLC播放器到我的项目。我需要覆盖视频与QgraphicsView (基本画布),这样我就能画东西。我试过这样做:
我在这个论坛上读到,有人提取每一帧,并将其设置为像素映射到一个对象。我看到了代码,但是我没有理解它,因为我不是C++专业人员:(我正在为Qt (PySide)和VLC使用(PySide))。请帮帮忙,真让我心烦:
http://forum.videolan.org/viewtopic.php?f=32&t=68816&p=228645
发布于 2013-07-06 10:35:45
最近,我用了集成声子播放器。可以将声子视频小部件作为GraphicsItem通过QGraphicsProxyWidget添加。在Windows背景下使用K编解码包就像一种魅力。
发布于 2014-01-31 09:57:38
我知道这个问题已经过去一段时间了,但我只是偶然发现了这个问题,今天我试图解决这个问题,并想出我的解决方案。
差不多你的第三次尝试是正确的,但你也必须使你使用的QGraphicsView透明,因为这是你看到的白色。您只需确保视图用setGeometry手动跟踪窗口,就可以设置好了。
#assuming you're inside a main window that is self
scene = QGraphicsScene()
scene.setBackgroundBrush(QBrush(QColor(255, 0,0,90))) #creates a semitransparent red over VLC
view = QGraphicsView(self)
view.setScene(self.scene)
view.setGeometry(0,0,self.width(),self.height())
self.view.setStyleSheet("background: transparent");https://stackoverflow.com/questions/17346149
复制相似问题