From 0b4f8bf7745a80743e63e7c631553411909f9753 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 15 Apr 2022 16:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E5=B9=95=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=EF=BC=8C=E5=85=88=E9=80=9Acli=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli_d_wf.py | 11 +++++++++++ worker/danmaku.py | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 cli_d_wf.py diff --git a/cli_d_wf.py b/cli_d_wf.py new file mode 100644 index 0000000..eb2d565 --- /dev/null +++ b/cli_d_wf.py @@ -0,0 +1,11 @@ +import argparse + +from worker.danmaku import do_workflow + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument("video", help="视频标准") + parser.add_argument("base", help="弹幕标准") + parser.add_argument("files", nargs="+", help="弹幕需要对齐") + args = parser.parse_args() + do_workflow(args.video, args.base, args.files) diff --git a/worker/danmaku.py b/worker/danmaku.py index 6a2cc1a..218dd95 100644 --- a/worker/danmaku.py +++ b/worker/danmaku.py @@ -25,11 +25,3 @@ def do_workflow(video_file, danmaku_base_file, *danmaku_files): encode_video_with_subtitles(video_file, result, new_file_name) quick_split_video(new_file_name) - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument("video", help="视频标准") - parser.add_argument("base", help="弹幕标准") - parser.add_argument("files", nargs="+", help="弹幕需要对齐") - args = parser.parse_args() - do_workflow(args.video, args.base, args.files)