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:
- Reading and saving opencv Python video
- ROS problem: vidioc_ S_ FMT error 16, Device or resource busy
- VIDEOIO ERROR: V4L: can’t open camera by index 0
- ROS package ROS_ astra_ Camera cannot open RGB lens
- User space operation GPIO error echo: write error: device or resource busy error resolution
- Solution to device or resource busy error in docker redeployment service
- ioctl,unlocked_ ioctl,compat_ The difference between IOCTL
- About the reason why the Raspberry Pi raspistill command cannot find the camera
- [Solved] CAP_IMAGES: can‘t find starting number (in the name of file)
- picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resource
- Opencv detection yolov4 target detection video stream error
- Linux error ttyname failed: inappropriate IOCTL for device solution
- The solution to the error of [Oracle] ora-00054
- Lock mechanism in Oracle
- Prompt “XXX is” when debugging real machine busy:Processing symbol Files “and” Xcode will continue when XXX is finished“
- The solution of Android package error
- C code compilation_ Error: expected expression before ‘Int’
- The function and usage of argc and argv in C language
- device no response, device descriptor read/64, error -71
- Troubleshooting of “disk I / O error” after startup