From 7a5fe106524df5cd86ee9dcf6e2cac76c9826321 Mon Sep 17 00:00:00 2001 From: Peter Körner Date: Tue, 27 Sep 2016 10:02:01 +0200 Subject: adapt to pep8 style --- voctocore/lib/avpreviewoutput.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'voctocore/lib') diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py index 91e2031..de4c95c 100644 --- a/voctocore/lib/avpreviewoutput.py +++ b/voctocore/lib/avpreviewoutput.py @@ -23,18 +23,19 @@ class AVPreviewOutput(TCPMultiConnection): if Config.getboolean('previews', 'deinterlace'): deinterlace = "deinterlace mode=interlaced !" - venc = 'jpegenc quality=90' - 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', - } - venc = encoders[encoder] - except Exception as e: - self.log.error(e) + venc = 'jpegenc quality=90' + 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', + } + venc = encoders[encoder] + except Exception as e: + self.log.error(e) pipeline = """ intervideosrc channel=video_{channel} ! @@ -43,7 +44,7 @@ class AVPreviewOutput(TCPMultiConnection): videoscale ! videorate ! {vcaps_out} ! - {venc} ! + {venc} ! queue ! mux. @@ -67,8 +68,8 @@ class AVPreviewOutput(TCPMultiConnection): acaps=Config.get('mix', 'audiocaps'), vcaps_in=Config.get('mix', 'videocaps'), vcaps_out=vcaps_out, - deinterlace=deinterlace, - venc=venc + deinterlace=deinterlace, + venc=venc ) self.log.debug('Creating Output-Pipeline:\n%s', pipeline) -- cgit v1.2.3