Follow-up to #618 (core fix on branch bugfix/container-audio-defaults-618).
Problem
select_audio_encoder_for_container resolves a container's default audio encoder in four tiers. Tier 3 treats the muxer-declared codec name as a literal encoder when it is not a key in AUDIO_CODEC_PREFERENCES:
is_audio_encoder_available(codec).then_some(codec)
is_audio_encoder_available is find_by_name(..).is_some() (codec_registry.rs:139), which happily finds FFmpeg's native vorbis and opus encoders. Both carry AV_CODEC_CAP_EXPERIMENTAL and fail at open unless strict_std_compliance is set to experimental — and no rdlp call site sets it. (The two FF_COMPLIANCE_NORMAL uses at ffi_helpers/mod.rs:256 and thumbnail/mod.rs:186 are avformat_query_codec muxer queries, not encoder contexts.)
So on a build without libvorbis, Nut and WebM resolve to "vorbis" and fail at encoder open, where the tier-4 AAC fallback would previously have worked.
Why it was deferred rather than fixed
Scope
Smaller than the deferring comment claimed. The linked ffmpeg-the-third 4.1.0+ffmpeg-8.0 already exposes Codec::capabilities() -> Capabilities (src/codec/codec.rs:162) with Capabilities::EXPERIMENTAL (src/codec/capabilities.rs:15), so tier 3 can self-filter in roughly three lines. No plumbing to the encoder-open site is required.
Acceptance
Refs #618
Follow-up to #618 (core fix on branch
bugfix/container-audio-defaults-618).Problem
select_audio_encoder_for_containerresolves a container's default audio encoder in four tiers. Tier 3 treats the muxer-declared codec name as a literal encoder when it is not a key inAUDIO_CODEC_PREFERENCES:is_audio_encoder_availableisfind_by_name(..).is_some()(codec_registry.rs:139), which happily finds FFmpeg's nativevorbisandopusencoders. Both carryAV_CODEC_CAP_EXPERIMENTALand fail at open unlessstrict_std_complianceis set to experimental — and no rdlp call site sets it. (The twoFF_COMPLIANCE_NORMALuses atffi_helpers/mod.rs:256andthumbnail/mod.rs:186areavformat_query_codecmuxer queries, not encoder contexts.)So on a build without
libvorbis,NutandWebMresolve to"vorbis"and fail at encoder open, where the tier-4 AAC fallback would previously have worked.Why it was deferred rather than fixed
Scope
Smaller than the deferring comment claimed. The linked
ffmpeg-the-third 4.1.0+ffmpeg-8.0already exposesCodec::capabilities() -> Capabilities(src/codec/codec.rs:162) withCapabilities::EXPERIMENTAL(src/codec/capabilities.rs:15), so tier 3 can self-filter in roughly three lines. No plumbing to the encoder-open site is required.Acceptance
Capabilities::EXPERIMENTAL, so such a codec falls through to tier 4 instead of being selected.audio_encoder_registry.rsis removed.Refs #618