Compare commits

...

2 commits

Author SHA1 Message Date
j
856d12a90d fix cuts 2026-01-15 15:59:14 +00:00
j
0562515f68 extend list 2026-01-15 15:58:04 +00:00

View file

@ -22,11 +22,16 @@ def detect_cuts(path, seconds=True):
for segment in path: for segment in path:
info = ox.avinfo(segment) info = ox.avinfo(segment)
segment_cuts = detect_cuts(segment, seconds) segment_cuts = detect_cuts(segment, seconds)
if seconds: if segment_cuts:
cuts.append([c + position for c in segment_cuts]) if seconds:
else: if cuts:
fps = AspectRatio(info['video'][0]['framerate']) cuts.append(position)
cuts.append([c + int(position*fps) for c in segment_cuts]) cuts += [c + position for c in segment_cuts]
else:
if cuts:
cuts.append(int(position*fps))
fps = AspectRatio(info['video'][0]['framerate'])
cuts += [c + int(position*fps) for c in segment_cuts]
position += info['duration'] position += info['duration']
return cuts return cuts