fix: add fail-fast validation for unsupported codecs

Replace silent fallback to libx264 with explicit validation that raises
ValueError for unknown codec types. Prevents silent codec substitution.
This commit is contained in:
bymyself 2026-01-20 12:55:17 -08:00
parent dcbe072e8a
commit bb7c582b58

View File

@ -389,7 +389,9 @@ class VideoFromComponents(VideoInput):
VideoCodec.H264: "libx264",
VideoCodec.VP9: "libvpx-vp9",
}
ffmpeg_codec = codec_map.get(resolved_codec, "libx264")
if resolved_codec not in codec_map:
raise ValueError(f"Unsupported codec: {resolved_codec}")
ffmpeg_codec = codec_map[resolved_codec]
extra_kwargs = {}
if resolved_format != VideoContainer.AUTO: