You've already forked FrameTour-RenderWorker
改改bug
This commit is contained in:
@ -124,11 +124,11 @@ class FfmpegTask(object):
|
||||
|
||||
def get_ffmpeg_args(self):
|
||||
args = ['-y', '-hide_banner']
|
||||
video_output_str = "[0:v]"
|
||||
if self.task_type == 'encode':
|
||||
# args += ('-hwaccel', 'qsv', '-hwaccel_output_format', 'qsv')
|
||||
input_args = []
|
||||
filter_args = []
|
||||
output_args = ["-shortest", "-c:v", "h264_qsv"]
|
||||
output_args = ["-shortest", "-c:v", "h264_qsv", "-global_quality", "28", "-look_ahead", "1"]
|
||||
if self.annexb:
|
||||
output_args.append("-bsf:v")
|
||||
output_args.append("h264_mp4toannexb")
|
||||
@ -192,12 +192,7 @@ class FfmpegTask(object):
|
||||
f.write("file '"+input_file+"'\n")
|
||||
elif isinstance(input_file, FfmpegTask):
|
||||
f.write("file '" + input_file.get_output_file() + "'\n")
|
||||
input_args.append("-f")
|
||||
input_args.append("concat")
|
||||
input_args.append("-safe")
|
||||
input_args.append("0")
|
||||
input_args.append("-i")
|
||||
input_args.append(_tmp_file)
|
||||
input_args += ("-f", "concat", "-safe", "0", "-i", _tmp_file)
|
||||
output_args.append("-c:v")
|
||||
output_args.append("copy")
|
||||
if len(self.audios) > 0:
|
||||
@ -207,11 +202,9 @@ class FfmpegTask(object):
|
||||
output_args.append("copy")
|
||||
output_args.append("-f")
|
||||
output_args.append("mp4")
|
||||
output_args += ("-c:v", "h264_qsv", "-r", "25", "-global_quality", "28", "-look_ahead", "1")
|
||||
return args + input_args + output_args + [self.get_output_file()]
|
||||
output_args.append("-c:v")
|
||||
output_args.append("h264_qsv")
|
||||
output_args.append("-r")
|
||||
output_args.append("25")
|
||||
output_args += ("-c:v", "h264_qsv", "-r", "25", "-global_quality", "28", "-look_ahead", "1")
|
||||
filter_args = []
|
||||
video_output_str = "[0:v]"
|
||||
audio_output_str = "[0:a]"
|
||||
@ -266,7 +259,12 @@ class FfmpegTask(object):
|
||||
else:
|
||||
self.output_file = "rand_" + str(uuid.uuid4()) + ".mp4"
|
||||
else:
|
||||
self.output_file = file
|
||||
if isinstance(file, FfmpegTask):
|
||||
if file == self:
|
||||
return
|
||||
self.output_file = file.get_output_file()
|
||||
if type(file) is str:
|
||||
self.output_file = file
|
||||
|
||||
def check_annexb(self):
|
||||
for input_file in self.input_file:
|
||||
|
Reference in New Issue
Block a user