From 49188f70b86387f64b40aa8c86ec4633ebf534ad Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Wed, 17 Aug 2016 13:27:19 +0200 Subject: select vaapi-encoder for preview-output depending on config --- voctocore/lib/avpreviewoutput.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'voctocore/lib') diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py index 749249b..b2e8b4a 100644 --- a/voctocore/lib/avpreviewoutput.py +++ b/voctocore/lib/avpreviewoutput.py @@ -23,6 +23,18 @@ class AVPreviewOutput(TCPMultiConnection): if Config.getboolean('previews', 'deinterlace'): deinterlace = "deinterlace mode=interlaced !" + venc = 'jpegenc quality=90' + try: + encoder = Config.get('previews', 'vaapi') + encoders = { + 'h264': 'vaapih264enc', + 'jpeg': 'vaapijpegenc', + 'mpeg2': 'vaapimpeg2enc', + } + venc = encoders[encoder] + except Exception as e: + self.log.error(e) + pipeline = """ intervideosrc channel=video_{channel} ! {vcaps_in} ! @@ -30,7 +42,7 @@ class AVPreviewOutput(TCPMultiConnection): videoscale ! videorate ! {vcaps_out} ! - jpegenc quality=90 ! + {venc} ! queue ! mux. @@ -54,7 +66,8 @@ class AVPreviewOutput(TCPMultiConnection): acaps=Config.get('mix', 'audiocaps'), vcaps_in=Config.get('mix', 'videocaps'), vcaps_out=vcaps_out, - deinterlace=deinterlace + deinterlace=deinterlace, + venc=venc ) self.log.debug('Creating Output-Pipeline:\n%s', pipeline) -- cgit v1.2.3