warn if ffmpeg does not support requested format

This commit is contained in:
j 2015-12-24 21:32:17 +05:30
parent 49aa7e3746
commit 252158a216

View file

@ -16,6 +16,7 @@ class DistributedClient:
def __init__(self, url, name):
self.url = url
self.name = name
self.supported_formats = extract.supported_formats()
def ping(self, oshash):
try:
@ -44,6 +45,12 @@ class DistributedClient:
def encode(self, oshash, cmd, output):
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:
p = subprocess.Popen(cmd)
r = None