path might be a list of videos

This commit is contained in:
j 2026-01-15 15:54:10 +00:00
commit f9c935bc19

View file

@ -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'):