aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-08 11:33:11 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-08 11:33:11 +0100
commit1d54d61b78478762cbbaa7dd039520b9c3955f45 (patch)
tree5b848b74d53fff7c4e0bf510cba9ab2d9a06a0f2 /src/main.cpp
parent3553cd14f157fc133a2ffda4743aa93ca90f57d1 (diff)
Reconfigure quality, force refresh nvfbc frame, mention stutter in readme
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3b750a7..07275c7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -620,7 +620,6 @@ static AVFrame* create_audio_frame(AVCodecContext *audio_codec_context) {
static void open_video(AVCodecContext *codec_context, VideoQuality video_quality, bool very_old_gpu, gsr_gpu_vendor vendor, PixelFormat pixel_format, bool hdr) {
AVDictionary *options = nullptr;
if(vendor == GSR_GPU_VENDOR_NVIDIA) {
-#if 0
bool supports_p4 = false;
bool supports_p5 = false;
@@ -633,21 +632,20 @@ static void open_video(AVCodecContext *codec_context, VideoQuality video_quality
supports_p5 = true;
}
}
-#endif
if(codec_context->codec_id == AV_CODEC_ID_AV1) {
switch(video_quality) {
case VideoQuality::MEDIUM:
- av_dict_set_int(&options, "qp", 43, 0);
+ av_dict_set_int(&options, "qp", 37, 0);
break;
case VideoQuality::HIGH:
- av_dict_set_int(&options, "qp", 39, 0);
+ av_dict_set_int(&options, "qp", 32, 0);
break;
case VideoQuality::VERY_HIGH:
- av_dict_set_int(&options, "qp", 34, 0);
+ av_dict_set_int(&options, "qp", 28, 0);
break;
case VideoQuality::ULTRA:
- av_dict_set_int(&options, "qp", 28, 0);
+ av_dict_set_int(&options, "qp", 24, 0);
break;
}
} else if(very_old_gpu || codec_context->codec_id == AV_CODEC_ID_H264) {
@@ -668,20 +666,20 @@ static void open_video(AVCodecContext *codec_context, VideoQuality video_quality
} else {
switch(video_quality) {
case VideoQuality::MEDIUM:
- av_dict_set_int(&options, "qp", 40, 0);
+ av_dict_set_int(&options, "qp", 37, 0);
break;
case VideoQuality::HIGH:
- av_dict_set_int(&options, "qp", 35, 0);
+ av_dict_set_int(&options, "qp", 32, 0);
break;
case VideoQuality::VERY_HIGH:
- av_dict_set_int(&options, "qp", 30, 0);
+ av_dict_set_int(&options, "qp", 28, 0);
break;
case VideoQuality::ULTRA:
av_dict_set_int(&options, "qp", 24, 0);
break;
}
}
-#if 0
+
if(!supports_p4 && !supports_p5)
fprintf(stderr, "Info: your ffmpeg version is outdated. It's recommended that you use the flatpak version of gpu-screen-recorder version instead, which you can find at https://flathub.org/apps/details/com.dec05eba.gpu_screen_recorder\n");
@@ -704,7 +702,6 @@ static void open_video(AVCodecContext *codec_context, VideoQuality video_quality
av_dict_set(&options, "preset", supports_p4 ? "p4" : "medium", 0);
else
av_dict_set(&options, "preset", supports_p5 ? "p5" : "slow", 0);
-#endif
av_dict_set(&options, "tune", "hq", 0);
av_dict_set(&options, "rc", "constqp", 0);
@@ -752,7 +749,7 @@ static void open_video(AVCodecContext *codec_context, VideoQuality video_quality
} else {
switch(video_quality) {
case VideoQuality::MEDIUM:
- av_dict_set_int(&options, "qp", 36, 0);
+ av_dict_set_int(&options, "qp", 37, 0);
break;
case VideoQuality::HIGH:
av_dict_set_int(&options, "qp", 32, 0);