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