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