aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-10-04 02:44:46 +0200
committerdec05eba <dec05eba@protonmail.com>2022-10-04 02:44:46 +0200
commite8b16e8347f7d58cfa582e878d4ebb239c81c50a (patch)
treead2b3707d9f6841a98e626a8f45e5f3fbc47a588 /src/main.cpp
parentf55b71343774c1a4ac222879a6aa9da5cad4ec1e (diff)
Live stream: set gop to fps*2, bit rate for medium to lower value
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files 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;