You've already forked FrameTour-RenderWorker
片段有音频不可以copy
This commit is contained in:
@ -141,7 +141,7 @@ class FfmpegTask(object):
|
||||
return False
|
||||
if self.speed != 1:
|
||||
return False
|
||||
if len(self.audios) > 1:
|
||||
if len(self.audios) >= 1:
|
||||
return False
|
||||
if len(self.input_file) > 1:
|
||||
return False
|
||||
@ -277,16 +277,26 @@ class FfmpegTask(object):
|
||||
audio_output_str = ""
|
||||
audio_track_index = 0
|
||||
# output_args
|
||||
_tmp_file = "tmp_concat_"+str(time.time())+".txt"
|
||||
with open(_tmp_file, "w", encoding="utf-8") as f:
|
||||
for input_file in self.input_file:
|
||||
if type(input_file) is str:
|
||||
f.write("file '"+input_file+"'\n")
|
||||
elif isinstance(input_file, FfmpegTask):
|
||||
f.write("file '" + input_file.get_output_file() + "'\n")
|
||||
input_args += ["-f", "concat", "-safe", "0", "-i", _tmp_file]
|
||||
from util.ffmpeg import probe_video_audio
|
||||
self.mute = not probe_video_audio(_tmp_file, "concat")
|
||||
if len(self.input_file) == 1:
|
||||
_file = self.input_file[0]
|
||||
from util.ffmpeg import probe_video_audio
|
||||
if type(_file) is str:
|
||||
input_args += ["-i", _file]
|
||||
self.mute = not probe_video_audio(_file)
|
||||
elif isinstance(_file, FfmpegTask):
|
||||
input_args += ["-i", _file.get_output_file()]
|
||||
self.mute = not probe_video_audio(_file.get_output_file())
|
||||
else:
|
||||
_tmp_file = "tmp_concat_" + str(time.time()) + ".txt"
|
||||
from util.ffmpeg import probe_video_audio
|
||||
with open(_tmp_file, "w", encoding="utf-8") as f:
|
||||
for input_file in self.input_file:
|
||||
if type(input_file) is str:
|
||||
f.write("file '" + input_file + "'\n")
|
||||
elif isinstance(input_file, FfmpegTask):
|
||||
f.write("file '" + input_file.get_output_file() + "'\n")
|
||||
input_args += ["-f", "concat", "-safe", "0", "-i", _tmp_file]
|
||||
self.mute = not probe_video_audio(_tmp_file, "concat")
|
||||
output_args.append("-map")
|
||||
output_args.append("0:v")
|
||||
output_args.append("-c:v")
|
||||
|
Reference in New Issue
Block a user