This commit is contained in:
Haoming 2026-05-19 12:27:41 +08:00
parent 472309ff2d
commit 179873abf5

View File

@ -911,7 +911,7 @@ def fix_png_transparency(image: Image.Image):
return image
def save_video(p, frames: list[np.ndarray], fps: int = 16, *, basename: str = "", info: str = "", audio_copy: os.PathLike = None) -> str:
def save_video(p, frames: list[np.ndarray], fps: int = 16, *, basename: str = "", info: str = None, audio_copy: os.PathLike = None) -> str:
height, width, channels = frames[0].shape
assert channels == 3, "Frames must be in (H, W, 3) RGB format"
@ -1002,4 +1002,9 @@ def save_video(p, frames: list[np.ndarray], fps: int = 16, *, basename: str = ""
proc.stdin.close()
proc.wait()
if opts.save_txt and info is not None:
txt_fullfn = os.path.join(folder, f"{file_decoration}.txt")
with open(txt_fullfn, "w", encoding="utf8") as file:
file.write(f"{info}\n")
return fullfn