From c798e90b56ac25345c64cba27ff56da663fb5c0e Mon Sep 17 00:00:00 2001 From: "kyj@bowong.ai" Date: Thu, 24 Apr 2025 15:38:49 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E4=BF=AE=E5=A4=8Dffmpeg=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodes/video.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/nodes/video.py b/nodes/video.py index cbaefa3..9a89d61 100644 --- a/nodes/video.py +++ b/nodes/video.py @@ -284,21 +284,11 @@ class VideoChangeFPS: "copy", ] }) - try: - print(ff.cmd) - with open("user/ffmpeg.txt", "a") as log: - log.write("\n----"+f"{datetime.now()}----\n"+ff.cmd+"\n========\n") - process = subprocess.Popen( - ff.cmd, stdout=log, stderr=log - ) - except OSError as e: - if e.errno == errno.ENOENT: - raise FFExecutableNotFoundError(f"Executable '{ff.executable}' not found") - else: - raise - o_stdout, o_stderr = process.communicate() - if process.returncode != 0: - raise FFRuntimeError(ff.cmd, process.returncode, o_stdout, o_stderr) + print(ff.cmd) + with open("user/ffmpeg.txt", "a") as log: + log.write("\n----"+f"{datetime.now()}----\n"+ff.cmd+"\n========\n") + with open("user/ffmpeg.txt", "a") as log: + ff.run(stdout=log, stderr=log) return (output,) except: traceback.print_exc()