From 27c59525e585d4b33bfbb73fb521dca455e8e197 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Tue, 15 Oct 2013 12:20:22 -0400 Subject: [PATCH] Bug 922770 - Set stable frame threshold to be less than 4096 pixels;r=davehunt Turns out that 2048 was too few for certain cases (e.g. a scrollbar transitioning out) where things aren't actually changing very much. --- src/videocapture/videocapture/framediff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/videocapture/videocapture/framediff.py b/src/videocapture/videocapture/framediff.py index e59809b..429035b 100644 --- a/src/videocapture/videocapture/framediff.py +++ b/src/videocapture/videocapture/framediff.py @@ -89,12 +89,12 @@ def get_num_unique_frames(capture, threshold=0): def get_fps(capture, threshold=0): return get_num_unique_frames(capture, threshold=threshold) / capture.length -def get_stable_frame(capture, threshold = 2048): +def get_stable_frame(capture, threshold = 4096): framediff_sums = get_framediff_sums(capture) for i in range(len(framediff_sums)-1, 0, -1): if framediff_sums[i] > threshold: return i+1 return len(framediff_sums)-1 -def get_stable_frame_time(capture, threshold = 2048): +def get_stable_frame_time(capture, threshold = 4096): return get_stable_frame(capture, threshold) / 60.0