diff --git a/auto_editor/render/subtitle.py b/auto_editor/render/subtitle.py index fee35cd52..1da25216e 100644 --- a/auto_editor/render/subtitle.py +++ b/auto_editor/render/subtitle.py @@ -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}") @@ -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}") diff --git a/auto_editor/render/video.py b/auto_editor/render/video.py index f809e7355..3eb3be047 100644 --- a/auto_editor/render/video.py +++ b/auto_editor/render/video.py @@ -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}")