don't use same base for each fragment

This commit is contained in:
j 2023-11-20 23:08:48 +00:00
parent 37a2674f23
commit 7008fa7e1f

View file

@ -409,7 +409,9 @@ def render_all(options):
clips_used = [] clips_used = []
stats = defaultdict(lambda: 0) stats = defaultdict(lambda: 0)
fragment_base = base
for fragment in fragments: for fragment in fragments:
fragment_base += 1
fragment_id = int(fragment['name'].split(' ')[0]) fragment_id = int(fragment['name'].split(' ')[0])
name = fragment['name'].replace(' ', '_') name = fragment['name'].replace(' ', '_')
if fragment_id < 10: if fragment_id < 10:
@ -422,7 +424,7 @@ def render_all(options):
fragment_clips = fragment['clips'] fragment_clips = fragment['clips']
unused_fragment_clips = [c for c in fragment_clips if c not in clips_used] unused_fragment_clips = [c for c in fragment_clips if c not in clips_used]
print('fragment clips', len(fragment_clips), 'unused', len(unused_fragment_clips)) print('fragment clips', len(fragment_clips), 'unused', len(unused_fragment_clips))
scene, used = compose(unused_fragment_clips, target=target, base=base, voice_over=fragment['voice_over']) scene, used = compose(unused_fragment_clips, target=target, base=fragment_base, voice_over=fragment['voice_over'])
clips_used += used clips_used += used
scene_duration = get_scene_duration(scene) scene_duration = get_scene_duration(scene)
print("%s %6.3f -> %6.3f (%6.3f)" % (name, target, scene_duration, fragment_target)) print("%s %6.3f -> %6.3f (%6.3f)" % (name, target, scene_duration, fragment_target))