From a0822d29432be24b1928c43136bdad92a03a7925 Mon Sep 17 00:00:00 2001 From: Robin Ole Heinemann Date: Mon, 20 Jan 2025 13:40:26 +0100 Subject: [PATCH] only try to parse reencode progress if valid --- worker/transcribee_worker/reencode.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/worker/transcribee_worker/reencode.py b/worker/transcribee_worker/reencode.py index 982e4b1f..7aa85134 100644 --- a/worker/transcribee_worker/reencode.py +++ b/worker/transcribee_worker/reencode.py @@ -26,11 +26,12 @@ def read_progress(stdout: IO): key, value = raw_line.decode().strip().split("=", maxsplit=1) if key == "out_time_ms": - out_time_ms = int(value) - out_time_s = out_time_ms / 1e6 - progress_callback( - progress=out_time_s / duration, - ) + if value != "N/A": + out_time_ms = int(value) + out_time_s = out_time_ms / 1e6 + progress_callback( + progress=out_time_s / duration, + ) def work(_): pipeline = ffmpeg.input(input_path)