This commit is contained in:
Marco Strigl 2024-09-16 17:26:14 +00:00 committed by GitHub
commit e3641a46f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -184,6 +184,8 @@ def worker():
# prepend workdir to input file # prepend workdir to input file
task.infile = os.path.join(workdir, task.infile) task.infile = os.path.join(workdir, task.infile)
if task.audiofile:
task.audiofile = os.path.join(workdir, task.audiofile)
task.outfile = os.path.join(outdir, task.outfile) task.outfile = os.path.join(outdir, task.outfile)
task.workdir = workdir task.workdir = workdir

View file

@ -36,13 +36,16 @@ def easeDelay(easer, delay, t, b, c, d, *args):
class Rendertask: class Rendertask:
def __init__(self, infile, parameters={}, outfile=None, workdir='.', sequence=None): def __init__(self, infile, audiofile=None, parameters={}, outfile=None, workdir='.', sequence=None):
if isinstance(infile, list): if isinstance(infile, list):
self.infile = infile[0] self.infile = infile[0]
# self.audiofile = infile[1] self.audiofile = infile[1]
else: else:
self.infile = infile self.infile = infile
self.audiofile = None if audiofile:
self.audiofile = audiofile
else:
self.audiofile = None
self.parameters = parameters self.parameters = parameters
self.outfile = outfile self.outfile = outfile
self.workdir = workdir self.workdir = workdir
@ -200,7 +203,7 @@ def rendertask_video(task):
if task.audiofile is None: if task.audiofile is None:
cmd += '-map 1:0 -map 2:0 ' cmd += '-map 1:0 -map 2:0 '
else: else:
cmd += '-map 1:0 -c:a copy -map 2:0 -c:a copy ' cmd += '-map 1:a -c:a copy -map 2:a -c:a copy '
cmd += '-shortest -f mpegts "{0}"'.format(task.outfile) cmd += '-shortest -f mpegts "{0}"'.format(task.outfile)
elif task.outfile.endswith('.mov'): elif task.outfile.endswith('.mov'):
cmd = 'cd {0} && '.format(task.workdir) cmd = 'cd {0} && '.format(task.workdir)