From 7601af9917b22f97919bb805e670cb76a40b7e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 13 Jan 2023 00:58:34 +0100 Subject: [PATCH] fix default pipeline. --- internal/config/capture.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/internal/config/capture.go b/internal/config/capture.go index a02e0ea7..6b4b4fee 100644 --- a/internal/config/capture.go +++ b/internal/config/capture.go @@ -72,7 +72,7 @@ func (Capture) Init(cmd *cobra.Command) error { return err } - cmd.PersistentFlags().String("capture.video.pipelines", "", "pipelines config in JSON used for video streaming") + cmd.PersistentFlags().String("capture.video.pipelines", "[]", "pipelines config in JSON used for video streaming") if err := viper.BindPFlag("capture.video.pipelines", cmd.PersistentFlags().Lookup("capture.video.pipelines")); err != nil { return err } @@ -190,12 +190,22 @@ func (s *Capture) Set() { s.VideoCodec = codec.VP8() s.VideoPipelines = map[string]types.VideoConfig{ "main": { - GstPipeline: "ximagesrc display-name={display} show-pointer=false use-damage=false " + - "! video/x-raw " + - "! videoconvert " + - "! queue " + - "! vp8enc end-usage=cbr cpu-used=4 threads=4 deadline=1 keyframe-max-dist=25 " + - "! appsink name=appsink", + Fps: "25", + GstEncoder: "vp8enc", + GstParams: map[string]string{ + "target-bitrate": "round(3072 * 650)", + "cpu-used": "4", + "end-usage": "cbr", + "threads": "4", + "deadline": "1", + "undershoot": "95", + "buffer-size": "(3072 * 4)", + "buffer-initial-size": "(3072 * 2)", + "buffer-optimal-size": "(3072 * 3)", + "keyframe-max-dist": "25", + "min-quantizer": "4", + "max-quantizer": "20", + }, }, } s.VideoIDs = []string{"main"}