ROS problem: vidioc_ S_ FMT error 16, Device or resource busy

Problem description
When using the camera under ROS, input:

$ roslaunch usb_cam usb_cam-test.launch

This command is to turn on the camera, and the error is as follows:

Namely: [ERROR] [1574317261.767618042]: VIDIOC_S_FMT ERROR 16, Device or resource busy
Replug the camera, still report this error.
Analysis: First check all the camera equipment, the instructions are as follows:

$ ls /dev/video*
/dev/video1

As you can see, the result is /dev/video1, and the default installation on ROS is usB_CAM with /dev/video0 started, so it’s not hard to imagine changing the launch file that launches the camera.
Solution: Enter the following two instructions:

$ cd /opt/ros/kinetic/share/usb_cam/launch
$ sudo gedit usb_cam-test.launch

The launch file is shown in the figure below:

Change the /dev/video0 that appears in line 3 to /dev/video1 (the number after the video here depends on the result of the previous query), save and exit. So you can use the camera properly. Problem solved.
Supplementary place
1. There is a detail here. After the above steps are modified, $roslaunch USb_CAM USb_cam_test.launch is required to use the camera normally.
2. After restarting the computer, the need for /dev/video will generally revert to 0, so the usB_cam-test.launch file needs to be modified again. Change the part of /dev/video to /dev/video0.

Read More: