uncommitted stuff: some bitrate changes [skip ci]

This commit is contained in:
Dominic 2024-06-23 23:59:23 +02:00
parent 6e56452f78
commit b6fb0fa184
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D

View file

@ -117,9 +117,8 @@ impl FfmpegOutput {
self self
} }
fn append_to_cmd(self, cmd: &mut Command, venc: bool, _aenc: bool, vaapi: bool) { fn append_to_cmd(self, cmd: &mut Command, venc: bool, _aenc: bool, mut vaapi: bool) {
// select codec and bitrate // select codec and bitrate/crf
const QUALITY: &str = "28";
if venc { if venc {
let vcodec = match (self.format, vaapi) { let vcodec = match (self.format, vaapi) {
(FfmpegOutputFormat::Av1Flac, false) (FfmpegOutputFormat::Av1Flac, false)
@ -134,19 +133,12 @@ impl FfmpegOutput {
if vcodec == "libsvtav1" { if vcodec == "libsvtav1" {
cmd.arg("-svtav1-params").arg("fast-decode=1"); cmd.arg("-svtav1-params").arg("fast-decode=1");
cmd.arg("-preset").arg("7"); cmd.arg("-preset").arg("7");
} cmd.arg("-crf").arg("28");
} else if vcodec == "h264" {
match self.video_bitrate { cmd.arg("-preset").arg("slow");
Some(bv) if vcodec != "libsvtav1" => { cmd.arg("-crf").arg("21");
cmd.arg("-b:v").arg(bv.to_string()); } else if let Some(bv) = self.video_bitrate {
}, 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 { } else {
cmd.arg("-c:v").arg("copy"); cmd.arg("-c:v").arg("copy");