videodev2
Python ctypes bindings for Video4Linux2 (V4L2) API
Overview
This package provides Python ctypes bindings for the Linux Video4Linux2 (V4L2) API, automatically generated from the videodev2.h header file. It includes all V4L2 structures, enums, constants, and IOCTL definitions needed for video device programming.
Installation
pip install videodev2
Usage
import videodev2
# Access V4L2 symbols through the videodev2 module
from videodev2 import videodev2
# Example: Query device capabilities
import fcntl
# Open video device
fd = open('/dev/video0', 'rb+', buffering=0)
# Query capabilities
cap = videodev2.v4l2_capability()
fcntl.ioctl(fd, videodev2.VIDIOC_QUERYCAP, cap)
print(f"Driver: {cap.driver.decode()}")
print(f"Card: {cap.card.decode()}")
# Set format
fmt = videodev2.v4l2_format()
fmt.type = videodev2.V4L2_BUF_TYPE_VIDEO_CAPTURE
fmt.fmt.pix.width = 640
fmt.fmt.pix.height = 480
fmt.fmt.pix.pixelformat = videodev2.v4l2_fourcc('Y', 'U', 'Y', 'V')
fcntl.ioctl(fd, videodev2.VIDIOC_S_FMT, fmt)
Features
- Complete V4L2 API coverage
- All structures, enums, and constants
- IOCTL definitions
- Helper functions (e.g.,
v4l2_fourcc) - Compatible with Python 3.6+
License
This project is licensed under the BSD 3-Clause License.
Metadata
Release files for videodev2 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| videodev2-0.0.4.tar.gz | 50.1 kB | Without provenance | Details for videodev2-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| videodev2-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for videodev2-0.0.4-py3-none-any.whl |
Total release size: 100.0 kB
Release files / videodev2-0.0.4.tar.gz
| Download URL | videodev2-0.0.4.tar.gz |
|---|---|
| Size | 50.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c34ba70491d148c23a08cbacd8efabeb413cff5baa943a7548ac4abd1eb19e2a
|
|
BLAKE2b-256 checksum How to use checksums |
7c82ffdba8838b1f24b83268863a8f66fe9334d7f28a5b9c368f9c48f7516e69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / videodev2-0.0.4-py3-none-any.whl
| Download URL | videodev2-0.0.4-py3-none-any.whl |
|---|---|
| Size | 49.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d35f7ab39ddb06d50fec96a99bfc8d5b8b525bc7ea03788259d386393f1a64ba
|
|
BLAKE2b-256 checksum How to use checksums |
68304982441a03860ab8f656702d8a2c13d0cf6f56d65bfb78fe288028dcb473
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for videodev2 0.0.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.