another logging issue
This commit is contained in:
@@ -227,7 +227,6 @@ final_clip.set_output()
|
||||
import threading
|
||||
|
||||
original_console = sys.__stdout__
|
||||
last_encoding_line = ""
|
||||
|
||||
with subprocess.Popen(vspipe_cmd, stdout=subprocess.PIPE) as vspipe_proc:
|
||||
with subprocess.Popen(
|
||||
@@ -241,7 +240,6 @@ final_clip.set_output()
|
||||
vspipe_proc.stdout.close()
|
||||
|
||||
def tee_output(proc_stdout, console):
|
||||
nonlocal last_encoding_line
|
||||
for line in proc_stdout:
|
||||
if console:
|
||||
try:
|
||||
@@ -249,17 +247,12 @@ final_clip.set_output()
|
||||
console.flush()
|
||||
except Exception:
|
||||
pass
|
||||
if "Encoding:" in line:
|
||||
last_encoding_line = line
|
||||
|
||||
tee_thread = threading.Thread(target=tee_output, args=(svt_proc.stdout, original_console))
|
||||
tee_thread.start()
|
||||
svt_proc.wait()
|
||||
tee_thread.join()
|
||||
|
||||
if last_encoding_line:
|
||||
print(last_encoding_line, end='')
|
||||
|
||||
if svt_proc.returncode != 0:
|
||||
raise RuntimeError(f"SvtAv1EncApp failed with exit code {svt_proc.returncode}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user