V4L2 Reference
Video4Linux (V4L for short) is a collection of device drivers and an API for supporting realtime video capture on Linux systems.[1]
Installation
The v4l2 drivers should have been integrated with the kernel in most recent Linux distributions. But you may need to install the utils separately.
For this package you get "v4l2-ctl".
v4l2-ctl
- Check v4l2 version
- List available v4l2 devices
- List supported formats of a device
$ v4l2-ctl --list-formats
$ v4l2-ctl --list-formats-ext
$ v4l2-ctl --list-formats-ext --device /dev/video0
- Set format to a device
- List available controls of a device
- Set control of a device
Typical Use Cases
- Pull video stream from a v4l2 device with specified format and desired frame rate
$ gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,framerate=90/1 ! \
jpegdec ! videoconvert ! fpsdisplaysink text-overlay=true video-sink="autovideosink"
Reference
- [1] https://en.wikipedia.org/wiki/Video4Linux
- [2] https://medium.com/@deepeshdeepakdd2/v4l-a-complete-practical-tutorial-c520f097b590
- [3] https://github.com/PhysicsX/Gstreamer-on-embedded-devices