Skip to main content

QVideo: Qt framework for video cameras

PyPI version Python License: GPL v3 Tests Documentation DOI

QVideo is a framework for integrating video cameras into Qt projects (PyQt5, PyQt6, or PySide) for scientific research. It provides a unified, registration-based property system so that every camera backend — USB webcams, GenICam devices, FLIR cameras, Raspberry Pi cameras — is controlled through the same API. Property trees, display widgets, and a digital video recorder are built on top of that abstraction and require no camera-specific code.

QVideo interface demo

Features

  • Unified camera API — QCamera subclasses expose adjustable parameters via registerProperty / registerMethod; UI and recording layers consume them without knowing the underlying hardware.
  • Auto-built property trees — QCameraTree reads the registered property map and builds a pyqtgraph parameter tree widget automatically.
  • Threaded video source — QVideoSource wraps any camera in a QThread and emits newFrame(ndarray) at acquisition rate.
  • Composable filter pipeline — VideoFilter / QFilterBank sit between source and display; filters include blur, edge detection, RGB channel selection, sample-and-hold, binary threshold, and blob coloring.
  • Graphical overlays — QTrackpyWidget for live particle tracking and QYoloWidget for real-time object detection render markers directly on QVideoScreen; composite mode lets the DVR record the annotated scene.
  • Digital video recorder — lossless HDF5 (with timestamps) and OpenCV video formats; QDVRWidget is the composite UI widget.
  • Live display — QVideoScreen supports mouse-aware graphical overlays for annotations, regions of interest, and user interaction.

Installation

pip install QVideo

Qt binding

QVideo works with PyQt5, PyQt6, or PySide. On x86/x86_64 a binding can be installed alongside QVideo:

pip install "QVideo[pyqt6]"   # PyQt6
pip install "QVideo[pyqt5]"   # PyQt5

Raspberry Pi

PyPI has no prebuilt ARM wheels for PyQt5 or PyQt6, so the system-provided packages must be used instead. Create the virtual environment with --system-site-packages so pip can see them:

sudo apt install python3-pyqt6 python3-pyqt6.qtsvg
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip install QVideo

Replace python3-pyqt6 with python3-pyqt5 if you prefer PyQt5.

Optional hardware backends

Backend Extra Notes
GenICam cameras (Vimba, etc.) pip install QVideo[genicam] Requires a vendor-supplied .cti producer file
Raspberry Pi camera pip install QVideo[picamera] Requires picamera2

Quick start

import pyqtgraph as pg
from QVideo.cameras.Noise import QNoiseSource
from QVideo.lib import QVideoScreen

pg.mkQApp()

source = QNoiseSource()          # synthetic noise — no hardware needed
screen = QVideoScreen()
source.newFrame.connect(screen.setImage)

screen.show()
source.start()
pg.exec()

Replace QNoiseSource with QOpenCVSource, QGenicamSource, etc. to switch hardware — the rest of the code is identical.

Camera backends

Backend Class Hardware
cameras/Noise QNoiseCamera Synthetic — no hardware required
cameras/OpenCV QOpenCVCamera USB webcams via OpenCV
cameras/Genicam QGenicamCamera Abstract base for all GenICam/GigE Vision cameras
cameras/Flir QFlirCamera FLIR cameras via GenICam (Spinnaker GenTL producer)
cameras/Basler QBaslerCamera Basler cameras via GenICam (pylon GenTL producer)
cameras/IDS QIDSCamera IDS Imaging cameras via GenICam
cameras/MV QMVCamera Any GenICam camera via MATRIX VISION mvGenTLProducer
cameras/Vimbax QVimbaXCamera Allied Vision cameras via VimbaX GenTL producer
cameras/Picamera QPicamera Raspberry Pi camera module

Writing a new camera backend

Subclass QCamera and implement three methods:

from QVideo.lib import QCamera

class MyCamera(QCamera):

    def _initialize(self) -> bool:
        self.device = open_my_hardware()
        if not self.device:
            return False
        self.registerProperty('exposure',
                              getter=lambda: self.device.get_exposure(),
                              setter=lambda v: self.device.set_exposure(v),
                              ptype=float)
        return True

    def _deinitialize(self) -> None:
        self.device.close()

    def read(self):
        ok, frame = self.device.read_frame()
        return ok, frame

QCameraTree and QVideoSource work with MyCamera immediately — no additional code needed.

Filters

Filter Class Description
Gaussian blur QBlurFilter Smoothing with adjustable kernel radius
Canny edge detection QEdgeFilter Edge map with configurable thresholds
RGB channel selection QRGBFilter Pass one or more color channels
Sample and hold QSampleHold Background normalization via a sampled median estimate
Binary threshold QThresholdFilter Convert to binary mask at a configurable level
Blob coloring QBlobFilter Color connected foreground regions with distinct hues
YOLO annotation QYOLOFilter Annotate frames with YOLO bounding boxes (requires ultralytics)

Overlays

Overlays render analysis results directly on the live QVideoScreen and require pip install QVideo[overlays].

Overlay Class Description
Particle tracking QTrackpyWidget Live particle detection and tracking using trackpy
Object detection QYoloWidget Real-time bounding-box detection using YOLO (ultralytics)

Acknowledgements

Work on this project at New York University is supported by the National Science Foundation of the United States under award number DMR-2428983 and by an award from the TAC Program of New York University.

Metadata

Release files for QVideo 3.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QVideo 3.18.0
File Size Uploaded
qvideo-3.18.0.tar.gz 252.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QVideo 3.18.0
File Interpreter ABI Platform
qvideo-3.18.0-py3-none-any.whl Python 3 none any Details

Total release size: 459.1 kB

Release files / qvideo-3.18.0.tar.gz

Download URL qvideo-3.18.0.tar.gz
Size 252.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6ea973b969571cd01ff9b30e3fb9847b4ddad701616e24cb4eb46f853eb6b937
BLAKE2b-256 checksum
How to use checksums
f354bea9b30d5447f7ca8fc43709fb1b94443c6a45b51baeb0dfb7fe2f90e7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / qvideo-3.18.0-py3-none-any.whl

Download URL qvideo-3.18.0-py3-none-any.whl
Size 206.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16a26fe035b85e7528b5ab9cf50856451b2a36d1fd115fce7235a603884045c6
BLAKE2b-256 checksum
How to use checksums
b78b53f1970ff90473ff6320e97e53b8f0d7c33f0c7304d7c88d29a3006d9746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.18.0 This release

2 release files

3.17.0

2 release files

3.16.8

2 release files

3.16.7

2 release files

3.16.6

2 release files

3.16.5

2 release files

3.16.4

2 release files

3.16.3

2 release files

3.16.2

2 release files

3.16.1

2 release files

3.16.0

2 release files

3.15.0

2 release files

3.14.1

2 release files

3.14.0

2 release files

3.13.1

2 release files

3.13.0

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.0

2 release files

3.9.0

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.9

2 release files

3.6.7

2 release files

3.6.5

2 release files

3.6.4

2 release files

3.6.3

2 release files

3.6.2

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page