From ed15405d2fb1ea651cae238f2c339f91bfed32b5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Apr 2022 16:33:39 +0200 Subject: p5 for high --- include/NvFBCLibrary.hpp | 3 +-- src/main.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/NvFBCLibrary.hpp b/include/NvFBCLibrary.hpp index e26264d..6d115a4 100644 --- a/include/NvFBCLibrary.hpp +++ b/include/NvFBCLibrary.hpp @@ -62,7 +62,7 @@ public: if(!library || !display_to_capture || !display_width || !display_height || fbc_handle_created) return false; - const bool capture_region = (x > 0 && y > 0 && width > 0 && height > 0); + const bool capture_region = (x > 0 || y > 0 || width > 0 || height > 0); NVFBCSTATUS status; NVFBC_TRACKING_TYPE tracking_type; @@ -130,7 +130,6 @@ public: } create_capture_params.eTrackingType = tracking_type; create_capture_params.dwSamplingRateMs = 1000 / fps; - // Cant use this, it breaks when a compositor is used create_capture_params.bAllowDirectCapture = direct_capture ? NVFBC_TRUE : NVFBC_FALSE; create_capture_params.bPushModel = direct_capture ? NVFBC_TRUE : NVFBC_FALSE; if(tracking_type == NVFBC_TRACKING_OUTPUT) diff --git a/src/main.cpp b/src/main.cpp index ea1f2fc..469e779 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -454,7 +454,7 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con //av_opt_set(codec_context->priv_data, "preset", "slow", 0); //av_opt_set(codec_context->priv_data, "profile", "high", 0); //codec_context->profile = FF_PROFILE_H264_HIGH; - av_opt_set(codec_context->priv_data, "preset", "p6", 0); + av_opt_set(codec_context->priv_data, "preset", "p5", 0); break; case VideoQuality::ULTRA: codec_context->bit_rate = 10000000 + (codec_context->width * codec_context->height) / 2; @@ -472,6 +472,7 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con // stream->time_base = codec_context->time_base; // codec_context->ticks_per_frame = 30; av_opt_set(codec_context->priv_data, "tune", "hq", 0); + //av_opt_set(codec_context->priv_data, "rc", "vbr", 0); // Some formats want stream headers to be seperate if (av_format_context->oformat->flags & AVFMT_GLOBALHEADER) -- cgit v1.2.3