From 120e7895b07b4f397d39852ad8f78a96efe5d460 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 29 Oct 2023 19:51:26 +0100 Subject: [PATCH 1/2] formating --- render.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render.py b/render.py index d603f04..db35c72 100644 --- a/render.py +++ b/render.py @@ -308,12 +308,12 @@ def render_all(options): scene = compose(fragment['clips'], target=target, base=base, voice_over=fragment['voice_over']) scene_duration = get_scene_duration(scene) - print("%s %s -> %s (%s)" % (name, target, scene_duration, fragment_target)) + print("%s %6.3f -> %6.3f (%6.3f)" % (name, target, scene_duration, fragment_target)) position += scene_duration target_position += fragment_target if position > target_position: target = fragment_target - (position-target_position) - print("adjusting target from", fragment_target, target) + print("adjusting target duration for next fragment: %6.3f -> %6.3f" % (fragment_target, target)) elif position < target_position: target = target + 0.1 * fragment_target From 21d32252699dd9fbb7c76becee760cbe73236678 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 29 Oct 2023 19:57:39 +0100 Subject: [PATCH 2/2] fail for 0 lenght clips --- management/commands/generate_clips.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/management/commands/generate_clips.py b/management/commands/generate_clips.py index 270c6bd..94098cc 100644 --- a/management/commands/generate_clips.py +++ b/management/commands/generate_clips.py @@ -52,6 +52,9 @@ class Command(BaseCommand): clip[type_] = target durations.append(e.files.filter(selected=True)[0].duration) clip["duration"] = min(durations) + if not clip["duration"]: + print('!!', durations, clip) + continue clip['tags'] = i.data.get('tags', []) clip['editingtags'] = i.data.get('editingtags', []) name = os.path.basename(clip['original'])