Merge pull request #1771 from BrandonHalig/patch-3

Confirm out_time_ms is a number
pull/1808/head
Simon 2 years ago committed by GitHub
commit cce9320154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,8 +46,12 @@ class ProgressFfmpeg(threading.Thread):
if lines: if lines:
for line in lines: for line in lines:
if "out_time_ms" in line: if "out_time_ms" in line:
out_time_ms = line.split("=")[1] out_time_ms_str = line.split("=")[1].strip()
return int(out_time_ms) / 1000000.0 if out_time_ms_str.isnumeric():
return float(out_time_ms_str) / 1000000.0
else:
# Handle the case when "N/A" is encountered
return None
return None return None
def stop(self): def stop(self):

Loading…
Cancel
Save