render subtitles
This commit is contained in:
parent
efd5e7310a
commit
f00a023641
2 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue