This commit is contained in:
rolux 2013-07-26 14:34:49 +02:00
parent eff73f11fe
commit 212f1feaef

View file

@ -396,15 +396,15 @@ class Timelines():
is_cut = False is_cut = False
self.previous_distance = 0 self.previous_distance = 0
else: else:
if self.short_cut and frame_i - self.short_cut > 2: if self.short_cut and self.frame_i - self.short_cut > 2:
self.cuts.append(self.short_cut) self.cuts.append(self.short_cut)
self.short_cut = None self.short_cut = None
distance = self._get_distance(self.previous_frame_data, frame_data) distance = self._get_distance(self.previous_frame_data, frame_data)
is_cut = distance > 0.08 or (distance > 0.04 and abs(distance - self.previous_distance) > 0.04) is_cut = distance > 0.08 or (distance > 0.04 and abs(distance - self.previous_distance) > 0.04)
if is_cut: if is_cut:
if frame_i - (0 if not self.cuts else self.short_cut or self.cuts[-1]) < 3: if self.frame_i - (0 if not self.cuts else self.short_cut or self.cuts[-1]) < 3:
is_cut = False is_cut = False
self.short_cut = frame_i self.short_cut = self.frame_i
else: else:
self.cuts.append(self.frame_i) self.cuts.append(self.frame_i)
elif len(self.cut_frames) == self.max_cut_len: elif len(self.cut_frames) == self.max_cut_len: