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 // append encoding options
const QUALITY: &str = "22"; const QUALITY: &str = "22";
if venc {
if vaapi { if vaapi {
cmd.arg("-c:v").arg("h264_vaapi"); cmd.arg("-c:v").arg("h264_vaapi");
if self.video_bitrate.is_none() { if self.video_bitrate.is_none() {
cmd.arg("-rc_mode").arg("CQP"); cmd.arg("-rc_mode").arg("CQP");
cmd.arg("-global_quality").arg(QUALITY); cmd.arg("-global_quality").arg(QUALITY);
} }
} else if venc { } else {
cmd.arg("-c:v").arg("libx264"); cmd.arg("-c:v").arg("libx264");
if self.video_bitrate.is_none() { if self.video_bitrate.is_none() {
cmd.arg("-crf").arg(QUALITY); cmd.arg("-crf").arg(QUALITY);
} }
}
} else { } else {
cmd.arg("-c:v").arg("copy"); cmd.arg("-c:v").arg("copy");
} }