A simple, libv4l2-based frames capture library.
Libv4l2 is packaged by various distributions:
# apt-get install libv4l-dev
# dnf install libv4l-devel
# pacman -S v4l-utils
To install PyV4L2Camera make sure you have Cython installed and type:
$ pip install PyV4L2Camera
PyV4L2Camera is only compatible with Python 3.
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 are always welcome!