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(),
|
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||||
"-i", orig_filename, "-vf",
|
"-i", orig_filename, "-vf",
|
||||||
",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda",
|
",".join("subtitles=%s" % i for i in subtitles) + ",hwupload_cuda",
|
||||||
"-c:a", "copy", "-c:v", "h264_nvenc",
|
"-c:v", "h264_nvenc",
|
||||||
"-f", "mp4", "-b:v", VIDEO_BITRATE, "-rc:v", "vbr", "-tune:v", "hq",
|
|
||||||
*_common_ffmpeg_params(),
|
*_common_ffmpeg_params(),
|
||||||
# "-t", "10",
|
# "-t", "10",
|
||||||
new_filename
|
new_filename
|
||||||
@ -53,26 +52,13 @@ 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):
|
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")
|
print("[+]Use Intel QSV Acceleration")
|
||||||
encode_process = subprocess.Popen([
|
encode_process = subprocess.Popen([
|
||||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||||
"-hwaccel", "qsv", "-i", orig_filename, "-vf",
|
"-init_hw_device", "qsv=hw", "-filter_hw_device", "hw",
|
||||||
|
"-i", orig_filename, "-vf",
|
||||||
",".join("subtitles=%s" % i for i in subtitles),
|
",".join("subtitles=%s" % i for i in subtitles),
|
||||||
"-c:a", "copy", "-c:v", "h264_qsv",
|
"-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(),
|
*_common_ffmpeg_params(),
|
||||||
# "-t", "10",
|
# "-t", "10",
|
||||||
new_filename
|
new_filename
|
||||||
@ -86,8 +72,7 @@ def get_encode_process_use_cpu(orig_filename: str, subtitles: list[str], new_fil
|
|||||||
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
FFMPEG_EXEC, *_common_ffmpeg_setting(),
|
||||||
"-i", orig_filename, "-vf",
|
"-i", orig_filename, "-vf",
|
||||||
",".join("subtitles=%s" % i for i in subtitles),
|
",".join("subtitles=%s" % i for i in subtitles),
|
||||||
"-c:a", "copy", "-c:v", "h264",
|
"-c:v", "h264",
|
||||||
"-f", "mp4", "-b:v", VIDEO_BITRATE,
|
|
||||||
*_common_ffmpeg_params(),
|
*_common_ffmpeg_params(),
|
||||||
# "-t", "10",
|
# "-t", "10",
|
||||||
new_filename
|
new_filename
|
||||||
|
Loading…
x
Reference in New Issue
Block a user