server/images: support webm with multiple streams
This commit is contained in:
parent
0cfc9bcafd
commit
f42fbbdc56
|
@ -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.')
|
||||||
|
|
Loading…
Reference in New Issue