减少输出

This commit is contained in:
Jerry Yan 2022-05-02 11:46:09 +08:00
parent 8a7a883e2a
commit 1bcbdd1994

View File

@ -157,6 +157,8 @@ def encode_video_with_subtitles(orig_filename: str, subtitles: list[str], new_fi
def handle_ffmpeg_output(stderr: IO[bytes]) -> str:
out_time = "0:0:0.0"
speed = "0"
_i = 0
while True:
line = stderr.readline()
if line == b"":
@ -168,8 +170,10 @@ def handle_ffmpeg_output(stderr: IO[bytes]) -> str:
out_time = line.replace(b"out_time=", b"").decode().strip()
if line.startswith(b"speed="):
speed = line.replace(b"speed=", b"").decode().strip()
print("Speed:", out_time, "@", speed)
_i += 1
if _i % 60 == 30:
print("[>]Speed:", out_time, "@", speed)
print("[ ]Speed:", out_time, "@", speed)
return out_time