The article directories
Learn to record the causes of errors and their solutions
Learning record
I have searched many times on the Internet before, but I haven’t found a solution yet. Suddenly, I came up with a solution.
error
libv4l2: error setting pixformat: Device or resource busy
VIDEOIO ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT
What you see: Sometimes the camera doesn’t work, so you have to plug it in.
Reasons and solutions
I didn’t know why there was such an error. Recently, I read some relevant books and found that I was missing a key line of code.
int main( int argc, const char** argv )
{
VideoCapture cap;
cap.open(0);
if(!cap.isOpened())
return -1;
while(1)
{
Mat frame;
cap >> frame;
imshow("Video", frame);
if(waitKey(30) >= 0)
break;
}
cap.release();
return 0;
}
Where, the key sentence cap.release();
is used to release the cap of the camera.
will cause the above error if it is not released.
Read More:
- ROS problem: vidioc_ S_ FMT error 16, Device or resource busy
- About the reason why the Raspberry Pi raspistill command cannot find the camera
- Solution to device or resource busy error in docker redeployment service
- User space operation GPIO error echo: write error: device or resource busy error resolution
- fusermount: failed to unmount : Device or resource busy
- Ubuntu cannot access USB device, failed to create a proxy device for the USB device
- VIDEOIO ERROR: V4L: can’t open camera by index 0
- Error: EBUSY: resource busy or locked, rmdir ‘
- Error: EBUSY: resource busy or locked
- Raspberry Pi 3 installation and software configuration issues collection
- Solve the problem that the Raspberry Pi cannot start (dependency failed for Local File Systems)
- error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1, Raspberry Pi installation paramiko
- Raspberry Pi runs ubuntu-mate and reports Failed to start Load Kernel Modules error countermeasures
- Cesium uses mediastreamrecorder or mediarecorder to record and download videos, and turn on the camera for recording.
- Python failed to use PIL writer library. TTF, etc. oserror: cannot open resource
- failed to open usb interface: 0, error: RS2_USB_STATUS_ACCESS
- Virtualbox failed to attach usb, VERR_PDM_NO_USB_PORTS problem solved
- ROS package ROS_ astra_ Camera cannot open RGB lens
- Compiling the pi_kernel source code appears: fatal error: openssl/opensslv.h: No such file or directory
- device no response, device descriptor read/64, error -71