From 311a72a7c8b35d71287607312e5723a7453c1b09 Mon Sep 17 00:00:00 2001 From: Peter Körner Date: Tue, 27 Sep 2016 10:44:55 +0200 Subject: select old encoder-names for gstreamer <1.8 --- voctocore/lib/avpreviewoutput.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'voctocore') 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) -- cgit v1.2.3