aboutsummaryrefslogtreecommitdiff
path: root/voctocore/lib
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2016-08-17 13:27:19 +0200
committerPeter Körner <pkoerner@seibert-media.net>2016-09-27 10:00:05 +0200
commit49188f70b86387f64b40aa8c86ec4633ebf534ad (patch)
treec457073b1eaa09744d5c08ec0375733a86ff4f0d /voctocore/lib
parent93ed7357ff8c255a87c7412ba59f6fe4cbdd91e4 (diff)
select vaapi-encoder for preview-output depending on config
Diffstat (limited to 'voctocore/lib')
-rw-r--r--voctocore/lib/avpreviewoutput.py17
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)