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