optionally render srt subtitles
This commit is contained in:
parent
790ae53095
commit
ce51e8c2c4
1 changed files with 9 additions and 9 deletions
18
render.py
18
render.py
|
|
@ -374,15 +374,15 @@ def get_offset_duration(prefix):
|
||||||
def write_subtitles(data, folder, options):
|
def write_subtitles(data, folder, options):
|
||||||
data = fix_overlaps(data)
|
data = fix_overlaps(data)
|
||||||
path = folder / "front.srt"
|
path = folder / "front.srt"
|
||||||
'''
|
if options.get("subtitle_format") == "srt":
|
||||||
srt = ox.srt.encode(data)
|
srt = ox.srt.encode(data)
|
||||||
write_if_new(str(path), srt, 'b')
|
write_if_new(str(path), srt, 'b')
|
||||||
'''
|
else:
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
path = folder / "front.ass"
|
path = folder / "front.ass"
|
||||||
ass = ass_encode(data, options)
|
ass = ass_encode(data, options)
|
||||||
write_if_new(str(path), ass, '')
|
write_if_new(str(path), ass, '')
|
||||||
|
|
||||||
|
|
||||||
def render(root, scene, prefix='', options=None):
|
def render(root, scene, prefix='', options=None):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue