intel qsv压制
This commit is contained in:
parent
8562025b1e
commit
33f1afc976
@ -43,8 +43,7 @@ def get_encode_process_use_nvenc(orig_filename: str, subtitles: list[str], new_f
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda",
|
||||
"-c:a", "copy", "-c:v", "h264_nvenc",
|
||||
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq",
|
||||
"-c:v", "h264_nvenc",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
@ -53,30 +52,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):
|
||||
if platform.system().lower() == "windows":
|
||||
print("[+]Use Intel QSV Acceleration")
|
||||
encode_process = subprocess.Popen([
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-hwaccel", "qsv", "-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles),
|
||||
"-c:a", "copy", "-c:v", "h264_qsv",
|
||||
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
], stdout=subprocess.PIPE)
|
||||
else:
|
||||
print("[+]Use Intel VAAPI Acceleration")
|
||||
encode_process = subprocess.Popen([
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-hwaccel", "vaapi", "-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles) + ",hwupload",
|
||||
"-c:a", "copy", "-c:v", "h264_vaapi",
|
||||
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
], stdout=subprocess.PIPE)
|
||||
print("[+]Use Intel QSV Acceleration")
|
||||
encode_process = subprocess.Popen([
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-init_hw_device", "qsv=hw", "-filter_hw_device", "hw",
|
||||
"-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles),
|
||||
"-c:v", "h264_qsv",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
], stdout=subprocess.PIPE)
|
||||
return encode_process
|
||||
|
||||
|
||||
@ -86,8 +72,7 @@ def get_encode_process_use_cpu(orig_filename: str, subtitles: list[str], new_fil
|
||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||
"-i", orig_filename, "-vf",
|
||||
",".join("subtitles=%s" % i for i in subtitles),
|
||||
"-c:a", "copy", "-c:v", "h264",
|
||||
"-f", "mp4", "-b:v", VIDEO_BITRATE,
|
||||
"-c:v", "h264",
|
||||
*_common_ffmpeg_params(),
|
||||
# "-t", "10",
|
||||
new_filename
|
||||
|
Loading…
x
Reference in New Issue
Block a user