Skip to main content

Package for converting QVideoFrame to NDArray with Qt6

Project description

AraViQ6

Python package for converting QVideoFrame to NDArray with Qt6.

AraViQ is designed to be used with either PySide6 or PyQt6. However, PyQt6 is not available until the dependent package, qimage2ndarray, supports it.

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

How to use

User can construct a pipeline which converts QVideoFrame to ndarray, performs any desired processing and displays to the widget.


Video display pipeline

QVideoFrame to ndarray

QVideoFrame is acquired from media file (QMediaPlayer) or camera capture session (QMediaCaptureSession) by setting QVideoSink to them and listening to QVideoSink.videoFrameChanged signal.

To convert it, pass the video frame araviq6.FrameToArrayConverter and listen to FrameToArrayConverter.arrayChanged signal.

For convenience, araviq6 provides NDArrayVideoPlayer and NDArrayMediaCaptureSession with pre-built pipelines. They inherit their Qt6 counterparts and emit arrayChanged signal.

(Note) If you want to convert a single QImage to ndarray, qimage2ndarray package provides handy functions.

Displaying ndarray

araviq6.NDArrayLabel is a widget to directly display ndarray. It can also scale the image with respect to the widget size, and user can select the scaling mode.

Convenience widgets

NDArrayVideoPlayerWidget and NDArrayCameraWidget are the minimal implementation to perform array-wise operation on video stream and display. However, time-consuming image processing will block the GUI with these classes because they use a single thread. To build multithread pipeline, refer to the examples.

Examples

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

Documentation

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.

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

Download files

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

Source Distribution

araviq6-1.0.1.1.tar.gz (186.1 kB view details)

Uploaded Source

Built Distribution

araviq6-1.0.1.1-py3-none-any.whl (185.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for araviq6-1.0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2cdacec8397810f1454d17c47427e2963414d4f8a2aba2c51010a21abb48ee9
MD5 246f6e397994f6399fdbde8637a962ae
BLAKE2b-256 01bb0eb2d20c00d522b7257b527e29515d08ebec21617a303f24e5dedf0231dd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for araviq6-1.0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d5fca7bd966338e64138bfc696ecb6595835a1dabc577d3deb8901a081188be
MD5 ec4a48bd25ecccd3595bce77c3dc91f8
BLAKE2b-256 5df26d5ce7047f4962417ec20b6edbd7b02e0a4a245f507c8647dfb23b2291ef

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