UVC Cameras on Linux
Command Line Operations
Install V4L utility packages
sudo apt-get update
sudo apt-get install v4l-utils
List the UVC devices connected to the USB port
v4l2-ctl --list-devices
Some devices will display 2 video nodes as follows:
One of the devices is used for regular YUV/MJPEG compression outputs, and the other is used for H.264 coding output. The users can use different programs to open the two devices at the same time, H.264 for streaming and MJPEG for audio recording or computer vision processing.
List the detailed information of each video node
You can check the features of each video node, like compression format, resolutions and so on.
List video0:
v4l2-ctl --list-formats-ext -d 0
List video1:
v4l2-ctl --list-formats-ext -d 1
Software Operations
qv4l2
- Supported Systems
Linux
- Download qv4l2
sudo apt update
sudo apt install qv4l2
- How to turn on the camera
Open the terminal and input following command:
qv4l2
- How to choose the Resolution and Frame rate
Before clicking the play button, you can select the following two drop-down boxes to select the resolution and frame rate:
- How to control other parameters
VLC media player
Install VLC media player
sudo apt install vlc
Open VLC
Right-click on the interface, go to Open Media -> Open Capture Device
In the Capture Device tab, you can select the capture mode and video device, or toggle the advanced options.
Here are the parameters you can toggle in the advanced options.
Once you click OK to save the advanced options and then Play in the Open Media window, you will be able to see the video feed.
Other Players
mplayer:
mplayer tv://-tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 30
mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -nosound -ovc lavc -o myvideo.avi
streamer
streamer -c /dev/video0 -f jpeg -F stereo -o myvideo.avi -t 0:05