server/images: support webm with multiple streams

This commit is contained in:
rr- 2017-01-25 17:12:06 +01:00
parent 0cfc9bcafd
commit f42fbbdc56
1 changed files with 6 additions and 2 deletions

View File

@ -36,6 +36,7 @@ class Image:
'-i', '{path}', '-i', '{path}',
'-f', 'image2', '-f', 'image2',
'-vf', _SCALE_FIT_FMT.format(width=width, height=height), '-vf', _SCALE_FIT_FMT.format(width=width, height=height),
'-map', '0:v:0',
'-vframes', '1', '-vframes', '1',
'-vcodec', 'png', '-vcodec', 'png',
'-', '-',
@ -56,6 +57,7 @@ class Image:
return self._execute([ return self._execute([
'-i', '{path}', '-i', '{path}',
'-f', 'image2', '-f', 'image2',
'-map', '0:v:0',
'-vframes', '1', '-vframes', '1',
'-vcodec', 'png', '-vcodec', 'png',
'-', '-',
@ -68,6 +70,7 @@ class Image:
'-i', '{path}', '-i', '{path}',
'-f', 'image2', '-f', 'image2',
'-filter_complex', 'overlay', '-filter_complex', 'overlay',
'-map', '0:v:0',
'-vframes', '1', '-vframes', '1',
'-vcodec', 'mjpeg', '-vcodec', 'mjpeg',
'-', '-',
@ -106,5 +109,6 @@ class Image:
], program='ffprobe').decode('utf-8')) ], program='ffprobe').decode('utf-8'))
assert 'format' in self.info assert 'format' in self.info
assert 'streams' in self.info assert 'streams' in self.info
if len(self.info['streams']) != 1: if len(self.info['streams']) < 1:
raise errors.ProcessingError('Multiple video streams detected.') logger.warning('The video contains no video streams.')
raise errors.ProcessingError('The video contains no video streams.')