Skip to main content

Package for converting QVideoFrame to NDArray with Qt6

Project description

AraViQ6 - NDArray from QVideoFrame with Qt6

PyPI version Python Version Build Status Documentation Status License

AraViQ6 is a Python package which integrates NDArray-based image processing with video pipeline of Qt6.

It provides:

  • QVideoFrame processor based on array processing
  • Converters between NDArray and QVideoFrame
  • Convenience classes and widgets for array displaying

The following Qt bindings are supported:

How to use

There are two ways to use AraViQ6; using QVideoFrame-based pipeline, or using NDArray-based pipeline.

Frame-based pipeline

Frame-based pipeline is a high-level approach that works well with Qt Multimedia scheme.


QVideoFrame pipeline with AraViQ6

Frame-based pipeline consists of:

  1. VideoFrameWorker
  2. VideoFrameProcessor

QVideoFrame comes from and goes to Qt6's QVideoSink. AraViQ6's VideoFrameWorker converts QVideoFrame to numpy array, performs processing, and sends the results to downstream in both QVideoFrame and NDArray. User may subclass the worker to define own processing.

VideoFrameProcessor wraps the worker and provides API around it. Worker is mulithreaded in the processor.

Array-based pipeline

Array-based pipeline is a low-level approach. It can be useful when third-party package provides video frame in numpy array format.


NDArray pipeline with AraViQ6

Array-based pipeline consists of:

  1. FrameToArrayConverter
  2. ArrayWorker
  3. ArrayProcessor
  4. ArrayToFrameConverter

FrameToArrayConverter and ArrayToFrameConverter performs conversion between frame pipeline and array pipeline. To retain the metadata (e.g., timestamp) of QVideoFrame, these classes includes the original frame for the array.

ArrayWorker performs processing on incoming array and sends the result to downstream in NDArray. User may subclass the worker to define own processing.

ArrayProcessor wraps the worker and provides API around it. Worker is mulithreaded in the processor.

Convenicence classes

AraViQ6 also provides various convenience classes to make building the pipeline easier.

The following classes help setting array pipeline with the video source and the display.

  • NDArrayVideoPlayer
  • NDArrayMediaCaptureSession
  • NDArrayLabel

The following classes are plug-and-play widgets where user can process the video with minimal boilerplate.

  • PlayerProcessWidget
  • CameraProcessWidget

Examples

Use cases are provided in examples directory. They can be found in documentation as well.

Installation

Before you install, be careful for other Qt-dependent packages installed in your environment. For example, non-headless OpenCV-Python modifies the Qt dependency thus can make other Qt bindings unavailable.

araviq6 can be installed using pip.

$ pip install araviq6

Documentation

AraViQ6 is documented with Sphinx. Documentation can be found on Read the Docs:

https://araviq6.readthedocs.io/

If you want to build the document yourself, clone the source code and install with [doc] option. Go to doc directory and build the document.

$ pip install araviq6[doc]
$ cd doc
$ make html

Document will be generated in build/html directory. Open index.html to see the central page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

araviq6-2.0.0.tar.gz (193.0 kB view details)

Uploaded Source

Built Distribution

araviq6-2.0.0-py3-none-any.whl (192.9 kB view details)

Uploaded Python 3

File details

Details for the file araviq6-2.0.0.tar.gz.

File metadata

  • Download URL: araviq6-2.0.0.tar.gz
  • Upload date:
  • Size: 193.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for araviq6-2.0.0.tar.gz
Algorithm Hash digest
SHA256 432d499aac28c0ff74f49c64bb48f1c9c87c81d960ce864f36e41f08ce95daaa
MD5 e6d2defcbf088e4b0b05436766831a51
BLAKE2b-256 2002ce4ced99b896ded0697ecc881743d87dba460a669f31ff9a652a4777dd36

See more details on using hashes here.

File details

Details for the file araviq6-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: araviq6-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 192.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for araviq6-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ac2b5b31f95f785a55e5665b5c4ebf5ae69b7c8d72bae6c8f2af6a1a47d4e5d
MD5 e219794f7ad964e19180a8eecfda14ea
BLAKE2b-256 8c3b5e16a570c7f88c212e56c4fdc6be55b76713d2b414c0f8b3d5d0774b0d61

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page