]> www.vanbest.org Git - motioneye-debian/commitdiff
better available resolutions detection
authorCalin Crisan <ccrisan@gmail.com>
Mon, 12 May 2014 17:49:39 +0000 (20:49 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Mon, 12 May 2014 17:49:39 +0000 (20:49 +0300)
src/v4l2ctl.py
static/js/main.js
templates/main.html

index d097fcff57e2a35908ab4f26268170cf87e6e832..79e6a0da64a15f6047704bc40b8c6c967a2dd210 100644 (file)
@@ -71,7 +71,7 @@ def list_resolutions(device):
     logging.debug('listing resolutions of device %(device)s...' % {'device': device})
     
     resolutions = set()
-    output = subprocess.check_output('v4l2-ctl -d %(device)s --list-formats-ext | grep -oE "[0-9]+x[0-9]+" || true' % {
+    output = subprocess.check_output('v4l2-ctl -d %(device)s --list-formats-ext | grep -vi stepwise | grep -oE "[0-9]+x[0-9]+" || true' % {
             'device': device}, shell=True)
 
     for pair in output.split('\n'):
@@ -83,6 +83,9 @@ def list_resolutions(device):
         width = int(width)
         height = int(height)
         
+        if width < 96 or height < 96: # some reasonable minimal values
+            continue
+        
         resolutions.add((width, height))
         
         logging.debug('found resolution %(width)sx%(height)s for device %(device)s' % {
index fc033dbb1b9ac53331d2b63c377020923e05e5f8..5baf633cada37ecb5886e021be04dff8aff35a52 100644 (file)
@@ -1109,7 +1109,10 @@ function pushCameraConfig() {
     }
     
     /* also update the config stored in the camera frame div */
-    Object.update($('div.camera-frame#camera' + cameraId)[0].config, cameraConfig);
+    var cameraFrame = $('div.camera-frame#camera' + cameraId);
+    if (cameraFrame.length) {
+        Object.update(cameraFrame[0].config, cameraConfig);
+    }
 }
 
 function pushPreview(control) {
index 3d5594ebe11744f5324b01b607ef373e10803030..41a5e530662db2e03364fd8e38333fb9bde68684 100644 (file)
             <img class="main-loading-progress" src="{{STATIC_URL}}img/main-loading-progress.gif">
         </div>
         <div class="footer">
-            <div class="copyright-note">copyright &copy; Calin Crisan 2013</div>
+            <div class="copyright-note">copyright &copy; Calin Crisan</div>
         </div> 
     </div>
     <div class="modal-glass"></div>