Video frame pipeline
cv2PySide6.videostream provides pipeline objects to get video stream in
numpy array.
- class cv2PySide6.videostream.FrameToArrayConverter(*args: Any, **kwargs: Any)[source]
Bases:
QObjectVideo pipeline component which converts
QVideoFrameto numpy array and emits toarrayChanged.QVideoFrameis first transformed toQImageand then converted to array byconverter().QVideoPlayersends empty video frame at the end of video.ignoreNullFrame()determines whether null frame should be ignored or empty array should be emitted.- ignoreNullFrame() bool[source]
If True, null
QVideoFramepassed tosetVideoFrame()is be ignored. Else, empty array with shape(0, 0, 0)is emitted.
- setIgnoreNullFrame(ignore: bool)
Update
ignoreNullFrame().
- setVideoFrame(frame: PySide6.QtMultimedia.QVideoFrame)
Convert
QVideoFrametonumpy.ndarrayand emit tosetArray().
- class cv2PySide6.videostream.NDArrayVideoPlayer(*args: Any, **kwargs: Any)[source]
Bases:
QMediaPlayerMinimal implementation of video player which emits frames as numpy arrays to
arrayChangedsignal.User may use this class for convenience, or define their own pipeline.
- class cv2PySide6.videostream.NDArrayMediaCaptureSession(*args: Any, **kwargs: Any)[source]
Bases:
QMediaCaptureSessionMinimal implementation of media capture session which emits frames as numpy arrays to
arrayChangedsignal.User may use this class for convenience, or define their own pipeline.