Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes handling of audiofiles. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def worker():

# prepend workdir to input file
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.workdir = workdir

Expand Down
11 changes: 7 additions & 4 deletions renderlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ def easeDelay(easer, delay, t, b, c, d, *args):


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):
self.infile = infile[0]
# self.audiofile = infile[1]
self.audiofile = infile[1]
else:
self.infile = infile
self.audiofile = None
if audiofile:
self.audiofile = audiofile
else:
self.audiofile = None
self.parameters = parameters
self.outfile = outfile
self.workdir = workdir
Expand Down Expand Up @@ -188,7 +191,7 @@ def rendertask_video(task):
if task.audiofile is None:
cmd += '-map 1:0 -map 2:0 '
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)
elif task.outfile.endswith('.mov'):
cmd = 'cd {0} && '.format(task.workdir)
Expand Down