From f79f4191c641f522b46d571ff4bbfaf066b60859 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 19 Apr 2022 10:27:10 +0800 Subject: [PATCH] output handle progress=end line --- workflow/video.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/workflow/video.py b/workflow/video.py index 2636f80..546d2d2 100644 --- a/workflow/video.py +++ b/workflow/video.py @@ -38,16 +38,14 @@ def handle_ffmpeg_output(stderr: IO[bytes]) -> str: if line.strip() == b"progress=end": # 处理完毕 break - if PROD_ENV: - # 正式环境不要输出一大堆的东西了 - continue if line.startswith(b"out_time="): - cur_time = line.replace(b"out_time=", b"").decode() - print("CurTime", cur_time.strip()) - out_time = cur_time.strip() + out_time = line.replace(b"out_time=", b"").decode().strip() + if not PROD_ENV: + print("CurTime", out_time) if line.startswith(b"speed="): - speed = line.replace(b"speed=", b"").decode() - print("Speed", speed.strip()) + speed = line.replace(b"speed=", b"").decode().strip() + if not PROD_ENV: + print("Speed", speed) return out_time