render updates

This commit is contained in:
j 2026-01-22 12:24:32 +01:00
commit f6fbb9ab81
2 changed files with 110 additions and 3 deletions

View file

@ -187,16 +187,32 @@ def compose(clips, target=150, base=1024, voice_over=None, options=None):
if clip.get('volume') is not None:
volume_front = '%0.2f' % (float(volume_front) + clip['volume'])
volume_rear = '%0.2f' % (float(volume_rear) + clip['volume'])
audio_filter = {
'mono': [
["channels", "2"],
],
'dynamic_loudness': [
["target_loudness", "-35"],
["min_gain", "-15"],
["max_gin", "15"],
],
'volume': volume_front,
'fadein': '00:00:00.125'
}
scene['audio-front']['A2'].append({
'duration': clip['duration'],
'src': audio,
'filter': {'volume': volume_front},
'filter': audio_filter.copy()
})
'''
audio_filter['volume'] = volume_rear
scene['audio-rear']['A2'].append({
'duration': clip['duration'],
'src': audio,
'filter': {'volume': volume_rear},
'filter': audio_filter.copy()
})
'''
used.append(clip)
print("scene duration %0.3f (target: %0.3f, vo_min: %0.3f)" % (length, target, vo_min))
scene_duration = int(get_scene_duration(scene) * fps)
@ -309,6 +325,8 @@ def get_fragments(clips, voice_over, prefix):
fragment['tags'].append(sub['value'])
elif sub['key'] == "tags" and sub['operator'] == '!=':
fragment['tags'].append(sub['value'])
elif sub['key'] == 'type' and sub['value'] in ('source', ''):
pass
else:
print(l.name, 'unknown sub condition', sub)
elif con.get('key') == "tags" and con['operator'] == '==':
@ -829,6 +847,9 @@ def generate_clips(options):
else:
clip[type_] = target
durations.append(e.files.filter(selected=True)[0].duration)
if not durations:
print(i.public_id, 'no duration!', clip)
continue
clip["duration"] = min(durations)
# trim to a multiple of the output fps
d1 = int(clip["duration"] * 24) / 24
@ -849,7 +870,7 @@ def generate_clips(options):
seqid = re.sub(r"Night March_(\d+)", "S\\1_", seqid)
seqid = re.sub(r"_(\d+)H_(\d+)", "_S\\1\\2_", seqid)
seqid = seqid.split('_')[:2]
seqid = [b[1:] if b[0] in ('B', 'S') else '0' for b in seqid]
seqid = [b[1:] if b[:1] in ('B', 'S') else '0' for b in seqid]
seqid[1] = resolve_roman(seqid[1])
seqid[1] = ''.join([b for b in seqid[1] if b.isdigit()])
if not seqid[1]: