aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-10-12 14:24:13 +0200
committerdec05eba <dec05eba@protonmail.com>2022-10-12 14:24:13 +0200
commit2a788b553347076d84c07e0098220af80a951771 (patch)
tree151cc8d6a5e66354426295cfa6ac0b709c911c81 /src
parent2bceeb182cdddd921874ee523ac0b528b1c9a278 (diff)
Use medium instead of p4 and slow instead of p7 for old ffmpeg
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp11
1 files 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);