diff options
author | MaZderMind <git@mazdermind.de> | 2016-10-01 18:12:42 +0200 |
---|---|---|
committer | MaZderMind <git@mazdermind.de> | 2016-10-01 18:25:34 +0200 |
commit | 70a456519018db33c41f543e1130a7cdcce40eaa (patch) | |
tree | ce7ef77d146ceb11b5572ba2c7f9339c5e0bcc5d /voctocore/lib/avpreviewoutput.py | |
parent | 793f63fcacff6f6bd09726b08d54c6ca23de9b07 (diff) |
figure out correct combination of caps to get vaapi-postproc working under gstreamer 1.6+
Diffstat (limited to 'voctocore/lib/avpreviewoutput.py')
-rw-r--r-- | voctocore/lib/avpreviewoutput.py | 10 |
1 files changed, 9 insertions, 1 deletions
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', |