Skip to content

Commit

Permalink
Fix ssa not being a known format
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Oct 25, 2024
1 parent add998d commit 2f6ff2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions auto_editor/render/subtitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ def make_new_subtitles(tl: v3, log: Log) -> list[str]:
continue

parser = SubtitleParser(tl.tb)
if sub.codec in ("webvtt", "ass", "ssa"):
if sub.codec == "ssa":
format = "ass"
elif sub.codec in ("webvtt", "ass"):
format = sub.codec
else:
log.error(f"Unknown subtitle codec: {sub.codec}")
Expand All @@ -196,7 +198,7 @@ def make_new_subtitles(tl: v3, log: Log) -> list[str]:
ret = make_srt(input_, s)
else:
ret = _ensure(input_, format, s)
parser.parse(ret, sub.codec)
parser.parse(ret, format)
parser.edit(tl.v1.chunks)

new_path = os.path.join(log.temp, f"new{s}s.{sub.ext}")
Expand Down
10 changes: 5 additions & 5 deletions auto_editor/render/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ def render_av(
frame = scale_graph.vpull()

if frame.format.name != target_pix_fmt:
frame = frame.reformat(format=target_pix_fmt)
yield frame.reformat(format=target_pix_fmt)
bar.tick(index)
elif index % 3 == 0:
bar.tick(index)

yield from_ndarray(frame.to_ndarray(), format=frame.format.name)
else:
yield from_ndarray(frame.to_ndarray(), format=frame.format.name)
if index % 3 == 0:
bar.tick(index)

bar.end()
log.debug(f"Total frames saved seeking: {frames_saved}")

0 comments on commit 2f6ff2e

Please sign in to comment.