use libsvtav1 instead of av1 when vaapi is disabled

This commit is contained in:
Dominic 2024-05-18 12:40:18 +02:00
parent 9d87c61a39
commit 0d98ab21f0
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D

View file

@ -104,13 +104,12 @@ impl FfmpegOutput {
// select codec and bitrate // select codec and bitrate
const QUALITY: &str = "22"; const QUALITY: &str = "22";
if venc { if venc {
let mut vcodec: String = match self.format { let vcodec = match (self.format, vaapi) {
FfmpegOutputFormat::Av1Flac | FfmpegOutputFormat::Av1Opus => "av1".into(), (FfmpegOutputFormat::Av1Flac, false) | (FfmpegOutputFormat::Av1Opus, false) => "libsvtav1",
FfmpegOutputFormat::AvcAac => "h264".into() (FfmpegOutputFormat::Av1Flac, true) | (FfmpegOutputFormat::Av1Opus, true) => "av1_vaapi",
(FfmpegOutputFormat::AvcAac, false) => "h264",
(FfmpegOutputFormat::AvcAac, true) => "h264_vaapi"
}; };
if vaapi {
vcodec = format!("{vcodec}_vaapi");
}
cmd.arg("-c:v").arg(vcodec); cmd.arg("-c:v").arg(vcodec);
if let Some(bv) = self.video_bitrate { if let Some(bv) = self.video_bitrate {