aboutsummaryrefslogtreecommitdiff
path: root/voctocore/lib/avpreviewoutput.py
diff options
context:
space:
mode:
Diffstat (limited to 'voctocore/lib/avpreviewoutput.py')
-rw-r--r--voctocore/lib/avpreviewoutput.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py
index de4c95c..03c83f7 100644
--- a/voctocore/lib/avpreviewoutput.py
+++ b/voctocore/lib/avpreviewoutput.py
@@ -27,12 +27,22 @@ class AVPreviewOutput(TCPMultiConnection):
if Config.has_option('previews', 'vaapi'):
try:
encoder = Config.get('previews', 'vaapi')
- encoders = {
- 'h264': 'vaapih264enc rate-control=cqp init-qp=23'
- 'cabac=false max-bframes=0 keyframe-period=60',
- 'jpeg': 'vaapijpegenc quality=90 keyframe-period=0',
- 'mpeg2': 'vaapimpeg2enc keyframe-period=60',
- }
+ if Gst.version() < (1, 8):
+ encoders = {
+ 'h264': 'vaapiencode_h264 rate-control=cqp init-qp=23'
+ 'cabac=false max-bframes=0 keyframe-period=60',
+ 'jpeg': 'vaapiencode_jpeg quality=90'
+ 'keyframe-period=0',
+ 'mpeg2': 'vaapiencode_mpeg2 keyframe-period=60',
+ }
+ else:
+ encoders = {
+ 'h264': 'vaapih264enc rate-control=cqp init-qp=23'
+ 'cabac=false max-bframes=0 keyframe-period=60',
+ 'jpeg': 'vaapijpegenc quality=90'
+ 'keyframe-period=0',
+ 'mpeg2': 'vaapimpeg2enc keyframe-period=60',
+ }
venc = encoders[encoder]
except Exception as e:
self.log.error(e)