diff options
author | Peter Körner <pkoerner@seibert-media.net> | 2016-09-27 10:44:55 +0200 |
---|---|---|
committer | Peter Körner <pkoerner@seibert-media.net> | 2016-09-27 10:44:55 +0200 |
commit | 311a72a7c8b35d71287607312e5723a7453c1b09 (patch) | |
tree | 0acd7a22730c572cb9a5ed9c580c56ff51ce3930 | |
parent | 7a5fe106524df5cd86ee9dcf6e2cac76c9826321 (diff) |
select old encoder-names for gstreamer <1.8
-rw-r--r-- | voctocore/lib/avpreviewoutput.py | 22 |
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) |