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