Long time listener, first time asker. Here is the situation:
I'm trying to read frames from multiple opencv (python) video capture device using the .read() functionality. When using opencv 2.4.11 the following error occurs at random times:
HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV Unable to stop the stream.: Bad file descriptor
This error appears to happen within the .read() call and even wrapping the call in a try/except fails to catch the problem as the .read() call never returns even as an exception.
When trying to update to the newest version of ocv(3.2.0) the .read() fails to return any frames.
Additional information: Machine: Linux Mint 18.1 Camera: https://www.amazon.com/ELP-megapixel-surveillance-machine-monitor/dp/B015FIKTZC Python: 2.7
Update: code:
The following takes place within a videoCamera class which holds a video object made initially from: self.video = cv2.VideoCapture(self.cameraSerialAddress)
Then a getFrame() call is made to this class, within this function is the following: try: retVal,frame = self.video.read()
if frame is None:
print("no frame available for camera: "+str(self.cameraSerialAddress) + " Reconnecting to camera")
self.video.release()
self.video = None
self.hasConnection = False
self.frame = None
return
elif frame is not None:
self.frame = frame
Thanks for the help, Kyle