From: Calin Crisan Date: Sat, 16 Nov 2013 21:33:14 +0000 (+0200) Subject: preview fixes X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d9999feb61116d533b5f1df0839580d722bf0156;p=motioneye-debian preview fixes --- diff --git a/src/mediafiles.py b/src/mediafiles.py index 32bfc86..c262f68 100644 --- a/src/mediafiles.py +++ b/src/mediafiles.py @@ -24,7 +24,6 @@ import subprocess from PIL import Image import config -import utils _PICTURE_EXTS = ['.jpg'] @@ -90,7 +89,8 @@ def make_movie_preview(camera_config, full_path): framerate = camera_config['framerate'] pre_capture = camera_config['pre_capture'] offs = pre_capture / framerate - offs *= 2 + offs = min(4, offs * 2) + cmd = 'ffmpeg -i "%(path)s" -f mjpeg -vframes 1 -ss %(offs)s -y %(path)s.thumb' % { 'path': full_path, 'offs': offs} diff --git a/static/js/main.js b/static/js/main.js index 9dde017..b0c68d5 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1380,7 +1380,7 @@ function runMediaDialog(cameraId, mediaType) { /* prepare the entries within each group */ keys.forEach(function (key) { var entries = groups[key]; - entries.sortKey(function (e) {return e.timestamp;}); + entries.sortKey(function (e) {return e.timestamp || e.name;}); entries.forEach(function (entry, pos) { var entryDiv = $('
');