use absolute path

This commit is contained in:
j 2016-06-16 14:48:09 +02:00
parent f25218466b
commit 0486d62ec9
1 changed files with 40 additions and 41 deletions

View File

@ -61,7 +61,6 @@ def supported_formats():
}
def stream(video, target, profile, info, audio_track=0, flags={}):
if not os.path.exists(target):
ox.makedirs(os.path.dirname(target))
@ -146,7 +145,6 @@ def stream(video, target, profile, info, audio_track=0, flags={}):
audiobitrate = '22k'
audiochannels = 1
if info['video'] and 'display_aspect_ratio' in info['video'][0]:
# dont make video bigger
height = min(height, info['video'][0]['height'])
@ -318,9 +316,9 @@ def run_command(cmd, timeout=10):
while timeout > 0:
time.sleep(0.2)
timeout -= 0.2
if p.poll() != None:
if p.poll() is not None:
return p.returncode
if p.poll() == None:
if p.poll() is None:
os.kill(p.pid, 9)
killedpid, stat = os.waitpid(p.pid, os.WNOHANG)
return p.returncode
@ -416,7 +414,8 @@ def timeline(video, prefix, modes=None, size=None):
size = [64, 16]
if isinstance(video, basestring):
video = [video]
cmd = ['../bin/oxtimelines',
cmd = [
os.path.join(settings.PROJECT_ROOT, '../bin/oxtimelines'),
'-s', ','.join(map(str, reversed(sorted(size)))),
'-m', ','.join(modes),
'-o', prefix,