From 252158a2169049ef5fdf27d1f442987c74c22716 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 24 Dec 2015 21:32:17 +0530 Subject: [PATCH] warn if ffmpeg does not support requested format --- pandora_client/client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_client/client.py b/pandora_client/client.py index 7618393..63c0e74 100644 --- a/pandora_client/client.py +++ b/pandora_client/client.py @@ -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 @@ -71,7 +78,7 @@ class DistributedClient: self.status(oshash, 'failed') if os.path.exists(output): os.unlink(output) - + def run(self): new = True while True: