render subtitles

This commit is contained in:
j 2023-11-14 17:48:55 +01:00
commit f00a023641
2 changed files with 20 additions and 1 deletions

View file

@ -99,9 +99,13 @@ class Command(BaseCommand):
if os.path.islink(target):
os.unlink(target)
os.symlink(src, target)
subs = []
for sub in vo.annotations.filter(layer="subtitles").exclude(value="").order_by("start"):
subs.append(sub.json(keys=['in', 'out', 'value']))
voice_over[fragment_id][batch] = {
"src": target,
"duration": source.duration
"duration": source.duration,
"subs": subs
}
with open(os.path.join(prefix, 'voice_over.json'), 'w') as fd:
json.dump(voice_over, fd, indent=2, ensure_ascii=False)