aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-18 00:11:23 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-18 11:15:10 +0200
commit41bd6cee631a16076435984891f2134443ecec31 (patch)
tree18e89b80a663a6b7980bb7f6f7fe453d5aa75684 /src/main.cpp
parent702c681a9566a0b49e66168f91ceac97e44cef97 (diff)
Use async_depth option on vaapi for much better encoding performance
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ddbf95b..fab768d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -887,6 +887,8 @@ static void open_video_hardware(AVCodecContext *codec_context, VideoQuality vide
} else {
// TODO: More quality options
//av_dict_set_int(&options, "low_power", 1, 0);
+ // Improves performance but increases vram
+ av_dict_set_int(&options, "async_depth", 8, 0);
if(codec_context->codec_id == AV_CODEC_ID_H264) {
// TODO:
@@ -3389,7 +3391,7 @@ int main(int argc, char **argv) {
const int64_t expected_frames = std::round((this_video_frame_time - record_start_time) / target_fps);
int num_frames = std::max((int64_t)0LL, expected_frames - video_pts_counter);
const double num_frames_seconds = num_frames * target_fps;
- if((damaged || num_frames_seconds >= damage_timeout_seconds) && !paused/* && fps_counter < fps + 100*/) {
+ if((damaged || (framerate_mode == FramerateMode::CONSTANT && num_frames > 0) || (framerate_mode != FramerateMode::CONSTANT && num_frames_seconds >= damage_timeout_seconds)) && !paused) {
gsr_damage_clear(&damage);
if(capture->clear_damage)
capture->clear_damage(capture);