A library for interacting with Video4Linux2 (V4L2) video devices
Project description
qamlib
This is a library meant to be an easy way to interact with a V4L2 camera, by
having a simple interface to capture images, and setup the camera. It is a
C++20 class (+ a few structs) together with optional Python bindings via
pybind11.
Do note that we currently don't really use or test the pure C++ build, so that might not be working entirely and will likely be lacking quite a bit of polish.
The Python bindings are the main usage of qamlib, so the C++ API is a bit of
a secondary concern.
There are also some features supported that are currently exclusive to Qtechnology A/S cameras, but these are not compiled when main-line kernel headers are detected.
Example
import qamlib
cam = qamlib.Camera("/dev/video0")
# Use context manager to start and stop streaming
with cam:
metadata, frame = cam.get_frame() # gets an image as raw bytes
# process image
See more in the documentation
Building
Python
Dependencies
gcclibstdc++-devnlohmann-jsonpybind11_jsonpython3-devpybind11setuptools
To build the module:
python setup.py build
To install the module (this also builds the module):
pip install .
C++
Dependicies
gccmesonninjanlohmann-json
To build the library we start by running meson setup:
meson setup build
Then to compile do
cd build
meson compile
To install the package, run (this also builds the library):
meson install
Testing
Under tests/ are some tests, these have only been actually tested on
Qtechnology A/S cameras.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qamlib-0.7.0.tar.gz.
File metadata
- Download URL: qamlib-0.7.0.tar.gz
- Upload date:
- Size: 62.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1779d8c4565efa1a53281641e187b0f2eb0202705eaec9ad42c01b9261f99b29
|
|
| MD5 |
0265f63c2511c80e275c39ad4de459f7
|
|
| BLAKE2b-256 |
b3b7f69543d43d2571f4c4dc21e7fba5e78603a54a3d23dcc423d989cca288ec
|
File details
Details for the file qamlib-0.7.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: qamlib-0.7.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 377.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba391bc89afddc8e9620f03cbad3fc90a4ca098a0c7f67c2f44375fabbdd47a
|
|
| MD5 |
14eaeccc1d84c9c765b6b81c113233d0
|
|
| BLAKE2b-256 |
d30eb0f8d1585711055764c60744080fa1a64d0e6b80df206dbb2886b62ffb5d
|