From 7f26d300e3982b243eed47ca09b9ec69142f7985 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 14 Nov 2022 00:57:03 -0800 Subject: [PATCH] Adjust crf --- stream.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stream.go b/stream.go index 5ca108e1..1851267a 100644 --- a/stream.go +++ b/stream.go @@ -313,11 +313,16 @@ func (s *Stream) transcode(startId int) { } // do not scale or set bitrate for full quality - if s.quality != "max" { + if s.quality == "max" { + args = append(args, []string{ + "-crf", "22", + }...) + } else { args = append(args, []string{ "-vf", scale, - "-maxrate", fmt.Sprintf("%dk", s.bitrate/1000), - "-bufsize", fmt.Sprintf("%dK", s.bitrate/1000), + "-crf", "24", + "-maxrate", fmt.Sprintf("%d", s.bitrate), + "-bufsize", fmt.Sprintf("%d", s.bitrate*2), }...) }