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 (PyQt6 or PyQt5; PySide6 is experimental) 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, FrameInfo) at acquisition rate.
  • Composable filter pipeline — VideoFilter objects run in a QFilterPipeline on a worker thread between source and consumers (display, recorder); 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; QRecorder and QPlayer work without a window, and QDVRWidget is their control panel.
  • Live display — QVideoScreen supports mouse-aware graphical overlays for annotations, regions of interest, and user interaction.

Installation

pip install "QVideo[pyqt6]"

Qt binding

QVideo needs a Qt binding: PyQt6 (recommended) or PyQt5. The binding is an optional extra so that QVideo can use one you already have, such as the system packages on a Raspberry Pi, instead of installing a second copy:

pip install "QVideo[pyqt6]"   # PyQt6 (recommended)
pip install "QVideo[pyqt5]"   # PyQt5
pip install QVideo            # use a binding that is already installed

PySide6 is experimental (pip install "QVideo[pyside6]"): the whole test suite passes under it in continuous integration on Linux, but the interpreter crashes at random while pyqtgraph builds a plot, in about half of the test runs on a Mac, so it is not yet recommended.

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 pip install QVideo[genicam] Installs viva-genicam (preferred, -g: no vendor SDK or .cti file, and it does not hold the interpreter lock) where it has wheels, and harvesters for vendor producers (Vimba, etc.), which need a .cti file and hold the interpreter lock, so QVideo opens them in a process of their own on macOS and Linux (see the compatibility page)
GenICam cameras, viva-genicam only pip install QVideo[viva] The preferred interface alone, without harvesters
Raspberry Pi camera pip install QVideo[picamera] Requires picamera2
Camera names for USB cameras pip install QVideo[opencv] Uses cv2-enumerate-cameras; without it the cameras are listed as "Camera 0" and so on
HDF5 recording (compressed without loss) pip install QVideo[dvr] Requires h5py and hdf5plugin
Faster lossless AVI/MKV, 16-bit gray pip install QVideo[av] Uses PyAV instead of OpenCV when installed

Quick start

from QVideo.cameras.Noise import QNoiseCamera
from QVideo.lib import QVideoScreen, QVideoSource
import pyqtgraph as pg   # after QVideo: QVideo selects the Qt binding

pg.mkQApp()

source = QVideoSource(QNoiseCamera())   # synthetic noise: no hardware
screen = QVideoScreen()
source.newFrame.connect(screen.setImage)

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

Replace QNoiseCamera with QOpenCVCamera, QFlirCamera, etc. to switch hardware — the rest of the code is identical.

In a Jupyter notebook

QVideo needs no window in a notebook. Install it into the notebook's own environment with the %pip magic, restart the kernel, and ask for a camera:

%pip install "QVideo[pyqt6,jupyter]"
from QVideo import Camera, Filter

camera = await Camera()                        # opens the camera it finds
camera.filters = Filter('Smoothing', 'Canny')  # optional; Filter() lists them
camera.live_view()                             # live video in the cell
frame = camera.read()                          # a (filtered) NumPy array

camera.controls() shows the camera's settings as widgets. See the Jupyter chapter for details, including what to do if widgets show up as text.

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/Viva QVivaCamera Any GenICam camera via viva-genicam (preferred; no producer)
cameras/Picamera QPicamera Raspberry Pi camera module

Compatibility

Verified on real hardware (the unit tests mock all hardware):

Backend macOS Ubuntu Raspberry Pi OS Windows
OpenCV 14 – 26 24.04 tested not tested
FLIR (GenICam) 14 – 26 24.04 — not tested
Raspberry Pi camera — — tested (Pi 5) —

On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV 5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been checked. See the documentation for details.

QVideo itself is pure Python and is tested on Python 3.11 – 3.14. The newest Python release may lag: Python 3.15 is run in CI as an allowed-failure job because some dependencies (e.g. scipy) do not yet publish wheels for it.

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. Each needs its own optional packages: pip install QVideo[trackpy] for the trackpy overlay, pip install QVideo[yolo] for the YOLO overlay (which pulls in PyTorch), or pip install QVideo[overlays] for both.

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 4.14.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 4.14.0
File Size Uploaded Provenance Actions
qvideo-4.14.0.tar.gz 358.5 kB With provenance Details for qvideo-4.14.0.tar.gz

Built distribution (wheel)

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

Total release size: 613.0 kB

Release files / qvideo-4.14.0.tar.gz

Download URL qvideo-4.14.0.tar.gz
Size 358.5 kB
Tags Source
SHA-256 checksum
How to use checksums
14c21573c53c923fa060c9146c880050d22661247037fb7c0475178eb8dbbf6d
BLAKE2b-256 checksum
How to use checksums
a843544708b58c0453252d8a461c6e1ccc674d4d49c723cfb7c26e9c3d0062f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL qvideo-4.14.0-py3-none-any.whl
Size 254.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d73f2a9939ecd2392e93e8da2560f14c8df552e9b78e004dc1e9a9a0991d8d2f
BLAKE2b-256 checksum
How to use checksums
9c8196efa3e722820fae0a7682d0349a475a8ed9bdd918b834de88bd6b0b05d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

Security for QVideo 4.14.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qvideo-4.14.0.tar.gz

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 Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.14.0 This release

2 release files Full provenance

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