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
|
||||||
|
|
Loading…
Reference in a new issue