From: Calin Crisan Date: Thu, 6 Aug 2015 16:39:43 +0000 (+0300) Subject: supress useless v4l2-ctl error message when listing devices on machines X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=81ca525dc5d91a46cdf9dddb943d247caec512db;p=motioneye-debian supress useless v4l2-ctl error message when listing devices on machines with no v4l2 devices --- diff --git a/src/handlers.py b/src/handlers.py index 34966e7..5921ac7 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -517,8 +517,6 @@ class ConfigHandler(BaseHandler): utils.test_mjpeg_url(self.get_data(), auth_modes=['basic', 'digest'], allow_jpeg=False, callback=on_response) elif proto == 'v4l2': - logging.debug('listing v4l2 devices') - configured_devices = set() for camera_id in config.get_camera_ids(): data = config.get_camera(camera_id) diff --git a/src/v4l2ctl.py b/src/v4l2ctl.py index 53de064..b466e2b 100644 --- a/src/v4l2ctl.py +++ b/src/v4l2ctl.py @@ -43,12 +43,12 @@ def find_v4l2_ctl(): def list_devices(): global _resolutions_cache, _ctrls_cache, _ctrl_values_cache - logging.debug('listing v4l devices...') + logging.debug('listing v4l2 devices...') try: output = '' started = time.time() - p = subprocess.Popen('v4l2-ctl --list-devices', shell=True, stdout=subprocess.PIPE, bufsize=1) + p = subprocess.Popen('v4l2-ctl --list-devices 2>/dev/null', shell=True, stdout=subprocess.PIPE, bufsize=1) fd = p.stdout.fileno() fl = fcntl.fcntl(fd, fcntl.F_GETFL)