windows 兼容性

This commit is contained in:
Jerry Yan 2022-07-02 14:02:08 +08:00
parent be617d6e33
commit aca066aad1

View File

@ -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",