diff options
Diffstat (limited to 'voctocore/lib/avpreviewoutput.py')
-rw-r--r-- | voctocore/lib/avpreviewoutput.py | 17 |
1 files changed, 15 insertions, 2 deletions
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) |