From 70a456519018db33c41f543e1130a7cdcce40eaa Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 1 Oct 2016 18:12:42 +0200 Subject: figure out correct combination of caps to get vaapi-postproc working under gstreamer 1.6+ --- voctocore/lib/avpreviewoutput.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'voctocore') diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py index a6f9cd4..05f1ceb 100644 --- a/voctocore/lib/avpreviewoutput.py +++ b/voctocore/lib/avpreviewoutput.py @@ -98,14 +98,18 @@ class AVPreviewOutput(TCPMultiConnection): struct = caps.get_structure(0) _, width = struct.get_int('width') _, height = struct.get_int('height') + _, framerate_numerator, framerate_denominator = struct.get_fraction('framerate') return ''' + capsfilter caps=video/x-raw,interlace-mode=progressive ! vaapipostproc + format=i420 deinterlace-mode={imode} deinterlace-method=motion-adaptive width={width} height={height} ! + capssetter caps=video/x-raw,framerate={n}/{d} ! {encoder} {options} '''.format( imode='interlaced' if do_deinterlace else 'disabled', @@ -113,13 +117,17 @@ class AVPreviewOutput(TCPMultiConnection): height=height, encoder=vaapi_encoders[encoder], options=vaapi_encoder_options[encoder], + n=framerate_numerator, + d=framerate_denominator, ) def construct_native_video_pipeline(self, target_caps): + do_deinterlace = Config.getboolean('previews', 'deinterlace') + return ''' videoscale ! {target_caps} ! - deinterlace mode={imode} !" + deinterlace mode={imode} ! jpegenc quality=90 '''.format( imode='interlaced' if do_deinterlace else 'disabled', -- cgit v1.2.3