You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plus, you have to install the pyqt-bounding-box since this uses it as a bounding box over the screen.
After did that you can just run it.
This is the result. You can move and resize it while playing the video.
So how to overlay and editable rectangle box? Read below.
self.__item=QGraphicsVideoItem()
self.__item.setAcceptDrops(True)
self.__box=BoundingBox()
self.__box.setColor(QColor(255, 255, 255))
# add both QGraphicsVideoItem and BoundingBox to scenescene.addItem(self.__item)
scene.addItem(self.__box)
w_f=float(self.contentsRect().size().width())
h_f=float(self.contentsRect().size().height())
self.__item.setSize(QSizeF(w_f, h_f))
self.__box.setSize(w_f, h_f)
# item should be stacked before the box, so you should use "stackBefore"# this makes you can move and resize the boxself.__item.stackBefore(self.__box)
self.setScene(scene)
This is the part of the source of videoGraphicsView.py
How to overlay an editable rectangle box when playing a video, similar to the entity QGraphicItem
The text was updated successfully, but these errors were encountered: