Skip to content

Commit

Permalink
only try to parse reencode progress if valid
Browse files Browse the repository at this point in the history
  • Loading branch information
rroohhh committed Jan 20, 2025
1 parent a75cfc4 commit a0822d2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions worker/transcribee_worker/reencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0822d2

Please sign in to comment.