diff --git a/pandora/archive/cutdetection.py b/pandora/archive/cutdetection.py index c50e6050..10e63299 100644 --- a/pandora/archive/cutdetection.py +++ b/pandora/archive/cutdetection.py @@ -16,6 +16,20 @@ def _get_distance(data0, data1): return total_distance / max_distance def detect_cuts(path, seconds=True): + if isinstance(path, list): + cuts = [] + position = 0 + for segment in path: + info = ox.avinfo(segment) + segment_cuts = detect_cuts(segment, seconds) + if seconds: + cuts.append([c + position for c in segment_cuts]) + else: + fps = AspectRatio(info['video'][0]['framerate']) + cuts.append([c + int(position*fps) for c in segment_cuts]) + position += info['duration'] + return cuts + depth = 3 info = ox.avinfo(path) if not info.get('video'):