feat(codec): log which AV1 encoder a session uses

Emit an explicit "AV1 encoder: svt-av1" / "AV1 encoder: aom" line at the
point the encoder is actually built, plus the reason ("i444" /
"unsupported resolution") when a 64-bit host falls back to aom for AV1.
Avoids relying on parsing Debug output or SVT's own stderr banner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Wf7v1KJM6mbhiYxWSz4PH
This commit is contained in:
rustdesk
2026-07-23 17:52:15 +08:00
parent 1ac684db0d
commit 8eda19247c
2 changed files with 31 additions and 15 deletions

View File

@@ -1033,15 +1033,25 @@ fn get_encoder_config(
// Prefer svt-av1 for AV1 encoding, keep aom for i444 (svt-av1 is 4:2:0
// only) and for resolutions svt-av1 cannot handle.
#[cfg(target_pointer_width = "64")]
if scrap::svt_av1::SvtAv1Encoder::support(c.width as _, c.height as _)
&& !Encoder::use_i444(&aom)
{
return EncoderCfg::SVTAV1(scrap::svt_av1::SvtAv1EncoderConfig {
width: c.width as _,
height: c.height as _,
quality,
keyframe_interval,
});
let use_i444 = Encoder::use_i444(&aom);
if scrap::svt_av1::SvtAv1Encoder::support(c.width as _, c.height as _) && !use_i444
{
return EncoderCfg::SVTAV1(scrap::svt_av1::SvtAv1EncoderConfig {
width: c.width as _,
height: c.height as _,
quality,
keyframe_interval,
});
}
log::info!(
"AV1 uses aom instead of svt-av1: {}",
if use_i444 {
"i444"
} else {
"unsupported resolution"
}
);
}
aom
}