Video widgets
araviq6.videowidgets provides convenience widgets with pre-built video
pipelines.
- class araviq6.videowidgets.PlayerProcessWidget(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetWidget to play video file with array processing.
By default this widget does not perform any array processing. User may define own
VideoFrameWorkerinstance and set bysetWorker().Examples
from PySide6.QtCore import QUrl from PySide6.QtWidgets import QApplication import sys from araviq6 import PlayerProcessWidget, VideoFrameWorker from araviq6.util import get_data_path class FlipWorker(VideoFrameWorker): def processArray(self, array): return array[::-1] def runGUI(): app = QApplication(sys.argv) w = PlayerProcessWidget() w.setWorker(FlipWorker()) w.setSource(QUrl.fromLocalFile(get_data_path('hello.mp4'))) w.show() app.exec() app.quit() runGUI() # doctest: +SKIP
- class araviq6.videowidgets.CameraProcessWidget(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetWidget to stream camera with array processing.
By default this widget does not perform any array processing. User may define own
VideoFrameWorkerinstance and set bysetWorker().Examples
from PySide6.QtWidgets import QApplication from PySide6.QtMultimedia import QCamera import sys from araviq6 import VideoFrameWorker, CameraProcessWidget class FlipWorker(VideoFrameWorker): def processArray(self, array): return array[::-1] def runGUI(): app = QApplication(sys.argv) widget = CameraProcessWidget() widget.setWorker(FlipWorker()) camera = QCamera() widget.setCamera(camera) camera.start() widget.show() app.exec() app.quit() runGUI() # doctest: +SKIP