From 2a788b553347076d84c07e0098220af80a951771 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 12 Oct 2022 14:24:13 +0200 Subject: Use medium instead of p4 and slow instead of p7 for old ffmpeg --- src/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8f12628..b449666 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -807,7 +807,7 @@ static void open_video(AVCodecContext *codec_context, } AVDictionary *options = nullptr; - if(very_old_gpu || !supports_p7) { + if(very_old_gpu) { switch(video_quality) { case VideoQuality::MEDIUM: av_dict_set_int(&options, "qp", 37, 0); @@ -853,10 +853,11 @@ static void open_video(AVCodecContext *codec_context, // with pretty good performance but you now have to choose p1-p7, which are gpu agnostic and on // older gpus p5-p7 slow the gpu down to a crawl... // "hq" is now just an alias for p7 in ffmpeg :( - if(very_old_gpu && supports_p4) - av_dict_set(&options, "preset", "p4", 0); - else if(supports_p7) - av_dict_set(&options, "preset", "p7", 0); + if(very_old_gpu) + av_dict_set(&options, "preset", supports_p4 ? "p4" : "medium", 0); + else + av_dict_set(&options, "preset", supports_p7 ? "p7" : "slow", 0); + av_dict_set(&options, "tune", "hq", 0); av_dict_set(&options, "rc", "constqp", 0); -- cgit v1.2.3