optimize some libsvtav1 params

This commit is contained in:
Dominic 2024-05-24 12:01:45 +02:00
parent d323915aed
commit 9a4b3142ff
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D
2 changed files with 20 additions and 11 deletions

View file

@ -102,7 +102,7 @@ impl FfmpegOutput {
fn append_to_cmd(self, cmd: &mut Command, venc: bool, _aenc: bool, vaapi: bool) {
// select codec and bitrate
const QUALITY: &str = "22";
const QUALITY: &str = "18";
if venc {
let vcodec = match (self.format, vaapi) {
(FfmpegOutputFormat::Av1Flac, false)
@ -114,13 +114,22 @@ impl FfmpegOutput {
};
cmd.arg("-c:v").arg(vcodec);
if let Some(bv) = self.video_bitrate {
cmd.arg("-b:v").arg(bv.to_string());
} else if vaapi {
cmd.arg("-rc_mode").arg("CQP");
cmd.arg("-global_quality").arg(QUALITY);
} else {
cmd.arg("-crf").arg(QUALITY);
if vcodec == "libsvtav1" {
cmd.arg("-svtav1-params").arg("fast-decode=1");
cmd.arg("-preset").arg("8");
}
match self.video_bitrate {
Some(bv) if vcodec != "libsvtav1" => {
cmd.arg("-b:v").arg(bv.to_string());
},
None if vaapi => {
cmd.arg("-rc_mode").arg("CQP");
cmd.arg("-global_quality").arg(QUALITY);
},
_ => {
cmd.arg("-crf").arg(QUALITY);
}
}
} else {
cmd.arg("-c:v").arg("copy");