fix multipass encoding for server/client
This commit is contained in:
parent
8df27cfb21
commit
bb2aafcb9d
2 changed files with 39 additions and 30 deletions
|
@ -44,7 +44,10 @@ class DistributedClient:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def encode(self, oshash, cmd, output):
|
def encode(self, oshash, cmds, output):
|
||||||
|
if not isinstance(cmds[0], list):
|
||||||
|
cmds = [cmds]
|
||||||
|
for cmd in cmds:
|
||||||
cmd[0] = extract.command('ffmpeg')
|
cmd[0] = extract.command('ffmpeg')
|
||||||
if 'webm' in cmd and not self.supported_formats['webm']:
|
if 'webm' in cmd and not self.supported_formats['webm']:
|
||||||
print("ffmpeg is compiled without WebM support")
|
print("ffmpeg is compiled without WebM support")
|
||||||
|
@ -73,6 +76,8 @@ class DistributedClient:
|
||||||
if os.path.exists(output):
|
if os.path.exists(output):
|
||||||
os.unlink(output)
|
os.unlink(output)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if r != 0:
|
||||||
|
break
|
||||||
if r == 0:
|
if r == 0:
|
||||||
self.upload(oshash, output)
|
self.upload(oshash, output)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -159,6 +159,10 @@ class Server(Resource):
|
||||||
url = 'http://%s:%s/get/%s' % (request.host.host, request.host.port, oshash)
|
url = 'http://%s:%s/get/%s' % (request.host.host, request.host.port, oshash)
|
||||||
output = '/tmp/%s.%s' % (oshash, self.client.profile(info))
|
output = '/tmp/%s.%s' % (oshash, self.client.profile(info))
|
||||||
response['cmd'] = extract.video_cmd(url, output, self.client.profile(info), info)
|
response['cmd'] = extract.video_cmd(url, output, self.client.profile(info), info)
|
||||||
|
if isinstance(response['cmd'][0], list):
|
||||||
|
for part in response['cmd']:
|
||||||
|
part[0] = 'ffmpeg'
|
||||||
|
else:
|
||||||
response['cmd'][0] = 'ffmpeg'
|
response['cmd'][0] = 'ffmpeg'
|
||||||
response['output'] = output
|
response['output'] = output
|
||||||
self.update_status(oshash, 'active')
|
self.update_status(oshash, 'active')
|
||||||
|
|
Loading…
Reference in a new issue