mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 13:44:14 +01:00
postprocess: figure out audio_filename before looking for tracks
This commit is contained in:
parent
1721ca1003
commit
806fc1d9d7
@ -104,7 +104,11 @@ class postprocess:
|
||||
|
||||
orig_filename = formatname(self.stream.output, self.config, self.stream.output_extention)
|
||||
name, ext = os.path.splitext(orig_filename)
|
||||
audio_filename = "{}.audio.ts".format(name)
|
||||
if ext == ".ts":
|
||||
audio_filename = "{}.audio.ts".format(name)
|
||||
else:
|
||||
audio_filename = "{}.m4a".format(name)
|
||||
|
||||
cmd = [self.detect, "-i", orig_filename, "-i", audio_filename]
|
||||
_, stdout, stderr = run_program(cmd, False) # return 1 is good here.
|
||||
streams = _streams(stderr)
|
||||
@ -120,8 +124,6 @@ class postprocess:
|
||||
if ext == ".ts":
|
||||
if audiotrack and "aac" in _getcodec(streams, audiotrack):
|
||||
arguments += ["-bsf:a", "aac_adtstoasc"]
|
||||
else:
|
||||
audio_filename = "{}.m4a".format(name)
|
||||
cmd = [self.detect, "-i", orig_filename, "-i", audio_filename]
|
||||
if videotrack:
|
||||
arguments += ["-map", "{}".format(videotrack)]
|
||||
|
Loading…
Reference in New Issue
Block a user