3434 STATUS = Status ()
3535 INFO = Info ()
3636LOG = logger .getLogger (__name__ )
37+ #LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
3738
3839# Suppress cryptic messages when checking for useable ports
3940os .environ ["OPENCV_LOG_LEVEL" ]= "FATAL"
@@ -326,6 +327,7 @@ def showEvent(self, event):
326327 try :
327328 self .video = WebcamVideoStream (src = self ._camNum )
328329 if not self .video .isOpened ():
330+
329331 p = self .video .list_ports ()[1 ]
330332 self .text = 'Error with video {}\n Available ports:\n {}' .format (self ._camNum , p )
331333 else :
@@ -450,7 +452,6 @@ def reset_camnum(self):
450452
451453class WebcamVideoStream :
452454 def __init__ (self , src = 0 , api = DEFAULT_API ):
453-
454455 # initialize the video camera stream and read the first frame
455456 # from the stream
456457 self .stream = self .openStream (src , api )
@@ -464,6 +465,10 @@ def __init__(self, src=0, api=DEFAULT_API):
464465 if plist != []:
465466 self .stream = self .openStream (plist [0 ], api )
466467
468+ width = int (self .stream .get (CV .CAP_PROP_FRAME_WIDTH ))
469+ height = int (self .stream .get (CV .CAP_PROP_FRAME_HEIGHT ))
470+ LOG .debug (f"Current camera resolution: { width } x{ height } " )
471+
467472 # initialize the variable used to indicate if the thread should
468473 # be stopped
469474 self .stopped = False
0 commit comments