From aca066aad1d7d3d48aa1620925d7b00a07d60911 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 2 Jul 2022 14:02:08 +0800 Subject: [PATCH] =?UTF-8?q?windows=20=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/video.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/workflow/video.py b/workflow/video.py index e154602..410751d 100644 --- a/workflow/video.py +++ b/workflow/video.py @@ -53,6 +53,17 @@ def get_encode_process_use_nvenc(orig_filename: str, subtitles: list[str], new_f def get_encode_process_use_intel(orig_filename: str, subtitles: list[str], new_filename: str): print("[+]Use Intel QSV Acceleration") + if platform.system().lower() == "windows": + encode_process = subprocess.Popen([ + FFMPEG_EXEC, *_common_ffmpeg_setting(), + "-hwaccel", "qsv", "-i", orig_filename, "-vf", + ",".join("subtitles=%s" % i for i in subtitles), + "-c:v", "h264_qsv", "-rc:v", "vbr", + *_common_ffmpeg_params(), + # "-t", "10", + new_filename + ], stdout=subprocess.PIPE) + return encode_process encode_process = subprocess.Popen([ FFMPEG_EXEC, *_common_ffmpeg_setting(), "-init_hw_device", "qsv=hw", "-filter_hw_device", "hw",