sort resolutions, use default fps if fps is 0

This commit is contained in:
j 2014-04-28 10:48:36 +02:00
parent 392504e239
commit c252583f6a
2 changed files with 5 additions and 2 deletions

View file

@ -139,7 +139,7 @@ class Client(object):
self._config = config
if not self._config['url'].endswith('/'):
self._config['url'] = self._config['url'] + '/'
self.resolutions = self._config.get('resolutions', [480])
self.resolutions = list(reversed(sorted(self._config.get('resolutions', [480]))))
self.format = self._config.get('format', 'webm')
self.importFrames = False

View file

@ -165,6 +165,9 @@ def video_cmd(video, target, profile, info):
if info['video'] and 'display_aspect_ratio' in info['video'][0]:
dar = AspectRatio(info['video'][0]['display_aspect_ratio'])
if info['video'][0]['framerate'] == '0:0':
fps = 25
else:
fps = AspectRatio(info['video'][0]['framerate'])
width = int(dar * height)
width += width % 2