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.

(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 classes

For convenience, araviq6 provides NDArrayVideoPlayer and NDArrayMediaCaptureSession which inherits their Qt6 counterparts and emits arrayChanged signal. NDArrayVideoPlayerWidget and NDArrayCameraWidget are the minimal implementation to display the video stream with them.

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 and build the pipeline yourself.

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.0.tar.gz (441.3 kB view details)

Uploaded Source

Built Distribution

araviq6-1.0.0-py3-none-any.whl (184.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for araviq6-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae4a1f244945014d87aa75bfcf736c7a07ba0d4148ab6f338a9cac8c7f9b89e7
MD5 7eab66ceeba0d88afa1c981cb245cdfb
BLAKE2b-256 3dd610afa7dd8be32f636ba81c7950bf2ca7e250ada165507ebf1f339b184b88

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for araviq6-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2060c8a252afd6cfa6aff1af3fd9f13ac6301e966bedf4dc2856358f87f11b76
MD5 0e7199ccc166ea7e9da9964d726d4a3f
BLAKE2b-256 b12b40021af33f01ce6a21544a47f3f2c1b46630ea863accfd22ef3da8ffce61

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