warn if ffmpeg does not support requested format
This commit is contained in:
parent
49aa7e3746
commit
252158a216
1 changed files with 8 additions and 1 deletions
|
@ -16,6 +16,7 @@ class DistributedClient:
|
||||||
def __init__(self, url, name):
|
def __init__(self, url, name):
|
||||||
self.url = url
|
self.url = url
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.supported_formats = extract.supported_formats()
|
||||||
|
|
||||||
def ping(self, oshash):
|
def ping(self, oshash):
|
||||||
try:
|
try:
|
||||||
|
@ -44,6 +45,12 @@ class DistributedClient:
|
||||||
|
|
||||||
def encode(self, oshash, cmd, output):
|
def encode(self, oshash, cmd, output):
|
||||||
cmd[0] = extract.command('ffmpeg')
|
cmd[0] = extract.command('ffmpeg')
|
||||||
|
if 'webm' in cmd and not self.supported_formats['webm']:
|
||||||
|
print "ffmpeg is compiled without WebM support"
|
||||||
|
return
|
||||||
|
elif cmd[-1].endswith('.mp4') and not self.supported_formats['webm']:
|
||||||
|
print "ffmpeg is compiled without H.264 support"
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(cmd)
|
p = subprocess.Popen(cmd)
|
||||||
r = None
|
r = None
|
||||||
|
@ -71,7 +78,7 @@ class DistributedClient:
|
||||||
self.status(oshash, 'failed')
|
self.status(oshash, 'failed')
|
||||||
if os.path.exists(output):
|
if os.path.exists(output):
|
||||||
os.unlink(output)
|
os.unlink(output)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
new = True
|
new = True
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in a new issue