From ac314969d9a146cd23edcd892f78cc40937c5d81 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 18 May 2022 10:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=89=B2=E8=A7=86=E9=A2=91=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E8=BF=9B=E7=A8=8B=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/video.py | 1 + workflow/worker.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow/video.py b/workflow/video.py index 5b352b8..c248db8 100644 --- a/workflow/video.py +++ b/workflow/video.py @@ -213,6 +213,7 @@ def quick_split_video(file): "{}.mp4".format(current_dt) ], stdout=subprocess.PIPE) handle_ffmpeg_output(split_process.stdout) + split_process.wait() current_sec += VIDEO_CLIP_EACH_SEC diff --git a/workflow/worker.py b/workflow/worker.py index 34f66be..94fa135 100644 --- a/workflow/worker.py +++ b/workflow/worker.py @@ -31,7 +31,9 @@ def do_workflow(video_file, danmaku_base_file, *danmaku_files): quick_split_video(filename) # clean files for filename in file_need_split: - os.remove(filename) + if os.path.isfile(filename): + os.remove(filename) for file in result: - os.remove(file) + if os.path.isfile(file): + os.remove(file)