aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrr-2017-01-25 17:12:06 +0100
committerrr-2017-01-25 17:13:39 +0100
commitf42fbbdc5657686b1061a0d27666b9a4f395c88c (patch)
tree2b3558590484df50b2b5928c03f4df6de27ae5d7
parent0cfc9bcafd716c736fab307cf02e3a34fa393cd5 (diff)
server/images: support webm with multiple streams
-rw-r--r--server/szurubooru/func/images.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/szurubooru/func/images.py b/server/szurubooru/func/images.py
index c7dfb34..a04d20d 100644
--- a/server/szurubooru/func/images.py
+++ b/server/szurubooru/func/images.py
@@ -36,6 +36,7 @@ class Image:
'-i', '{path}',
'-f', 'image2',
'-vf', _SCALE_FIT_FMT.format(width=width, height=height),
+ '-map', '0:v:0',
'-vframes', '1',
'-vcodec', 'png',
'-',
@@ -56,6 +57,7 @@ class Image:
return self._execute([
'-i', '{path}',
'-f', 'image2',
+ '-map', '0:v:0',
'-vframes', '1',
'-vcodec', 'png',
'-',
@@ -68,6 +70,7 @@ class Image:
'-i', '{path}',
'-f', 'image2',
'-filter_complex', 'overlay',
+ '-map', '0:v:0',
'-vframes', '1',
'-vcodec', 'mjpeg',
'-',
@@ -106,5 +109,6 @@ class Image:
], program='ffprobe').decode('utf-8'))
assert 'format' in self.info
assert 'streams' in self.info
- if len(self.info['streams']) != 1:
- raise errors.ProcessingError('Multiple video streams detected.')
+ if len(self.info['streams']) < 1:
+ logger.warning('The video contains no video streams.')
+ raise errors.ProcessingError('The video contains no video streams.')

© 2015 - 2026 Jakob L. Kreuze