/PyV4L2Camera

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

PyV4L2Camera

A simple, libv4l2-based frames capture library.

Installation

Libv4l2

Libv4l2 is packaged by various distributions:

Debian and Ubuntu

# apt-get install libv4l-dev

Fedora

# dnf install libv4l-devel

Arch Linux

# pacman -S v4l-utils

PyV4L2

To install PyV4L2Camera make sure you have Cython installed and type:

$ pip install PyV4L2Camera

PyV4L2Camera is only compatible with Python 3.

Usage

from PyV4L2Camera.camera import Camera

camera = Camera('/dev/video0')
frame = camera.get_frame()

The returned frame is of bytes type and contains pixels packed using RGB24 format. To learn more see V4L2_PIX_FMT_RGB24 description.

Example of frames to numpy arrays conversion can be found in the examples directory.

Contributions

Contributions are always welcome!

Authors

Dominik Pieczyński and contributors.