From e8b16e8347f7d58cfa582e878d4ebb239c81c50a Mon Sep 17 00:00:00 2001
From: dec05eba <dec05eba@protonmail.com>
Date: Tue, 4 Oct 2022 02:44:46 +0200
Subject: Live stream: set gop to fps*2, bit rate for medium to lower value

---
 src/main.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 5af3f01..0bf0c00 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -632,8 +632,9 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con
     if(is_livestream) {
         codec_context->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY);
         codec_context->flags2 |= AV_CODEC_FLAG2_FAST;
-        codec_context->gop_size = std::numeric_limits<int>::max();
-        codec_context->keyint_min = std::numeric_limits<int>::max();
+        //codec_context->gop_size = std::numeric_limits<int>::max();
+        //codec_context->keyint_min = std::numeric_limits<int>::max();
+        codec_context->gop_size = fps * 2;
     } else {
         codec_context->gop_size = fps * 2;
     }
@@ -644,7 +645,7 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con
         codec_context->codec_tag = MKTAG('h', 'v', 'c', '1');
     switch(video_quality) {
         case VideoQuality::MEDIUM:
-            codec_context->bit_rate = 6000000 + (codec_context->width * codec_context->height) / 2;
+            codec_context->bit_rate = 4500000 + (codec_context->width * codec_context->height) / 2;
             /*
             if(use_hevc) {
                 codec_context->qmin = 20;
-- 
cgit v1.2.3-70-g09d2