日志输出

This commit is contained in:
Jerry Yan 2022-05-31 16:50:59 +08:00
parent 13f18c5e6c
commit 05a804739f

View File

@ -24,7 +24,7 @@ def get_video_real_duration(filename):
def encode_video_with_subtitles(orig_filename: str, subtitles: list[str], base_ts: float): def encode_video_with_subtitles(orig_filename: str, subtitles: list[str], base_ts: float):
new_filename = base_ts_to_filename(base_ts, True) new_filename = base_ts_to_filename(base_ts, False)
new_fullpath = os.path.join(VIDEO_OUTPUT_DIR, new_filename) new_fullpath = os.path.join(VIDEO_OUTPUT_DIR, new_filename)
if FFMPEG_USE_NVIDIA_GPU: if FFMPEG_USE_NVIDIA_GPU:
process = get_encode_process_use_nvenc(orig_filename, subtitles, new_fullpath) process = get_encode_process_use_nvenc(orig_filename, subtitles, new_fullpath)
@ -114,6 +114,8 @@ def handle_ffmpeg_output(stdout: IO[bytes]) -> str:
if line.startswith(b"speed="): if line.startswith(b"speed="):
speed = line.replace(b"speed=", b"").decode().strip() speed = line.replace(b"speed=", b"").decode().strip()
_i += 1 _i += 1
if _i % 600 == 500:
print("[>]Speed:", out_time, "@", speed)
print("[ ]Speed:", out_time, "@", speed) print("[ ]Speed:", out_time, "@", speed)
return out_time return out_time