Hi, everyone.

I believe I have come across an issue in the documentation of the
QGraphicsVideoItem.

My current goal is to open a capture session using OpenCV and feed it into
a Qt GUI. The example at the bottom of the QGraphicsVideoItem documentation
shows that one could insert a QImage by using setVideoFrame. When
implementing this into my project I receive a TypeError stating that
QVideoFrame does not accept a QImage as an argument. I am using Python 3.10
and the latest version of PySide6.

I have seen that there are other ways to achieve this through means of
inserting the QImage into a QGraphicsPixMap or QLabel but this seems better
suited for single images. I am unsure of what the preferred method is for
video feeds. If the documentation is incorrect, and QGraphicsVideoItem
indeed can not accept a QImage on a frame by frame basis, what would be
another means of passing an OpenCV feed into a QGraphicsView? I was
informed via Qt Forum thread that using a C library function memcpy could
possibly work but this is an area I have not yet explored.

Here are some relevant links:
Qt Forum post -
https://forum.qt.io/topic/133052/qvideoframe-not-accepting-a-qimage-even-though-the-documentation-has-an-example
QGraphicsVideoItem documentation -
https://doc.qt.io/qtforpython/PySide6/QtMultimediaWidgets/QGraphicsVideoItem.html

Kind Regards,
Don
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside

Reply via email to