fix incorrectly setting vaapi output when copying codec

This commit is contained in:
Dominic 2023-11-16 11:52:17 +01:00
parent 5746939c06
commit 083bcb07c2
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -257,17 +257,19 @@ impl Ffmpeg {
// append encoding options
const QUALITY: &str = "22";
if venc {
if vaapi {
cmd.arg("-c:v").arg("h264_vaapi");
if self.video_bitrate.is_none() {
cmd.arg("-rc_mode").arg("CQP");
cmd.arg("-global_quality").arg(QUALITY);
}
} else if venc {
} else {
cmd.arg("-c:v").arg("libx264");
if self.video_bitrate.is_none() {
cmd.arg("-crf").arg(QUALITY);
}
}
} else {
cmd.arg("-c:v").arg("copy");
}