Select the first available codec from a priority list. Useful for graceful degradation: try hardware first, fall back to software.
const codec = selectBestCodec(version, registry, [ { codec: 'h264_nvenc', featureKey: 'nvenc' }, { codec: 'h264_vaapi', featureKey: 'vaapi' }, { codec: 'h264_mediacodec', featureKey: 'mediacodec' }, { codec: 'libx264' },]); Copy
const codec = selectBestCodec(version, registry, [ { codec: 'h264_nvenc', featureKey: 'nvenc' }, { codec: 'h264_vaapi', featureKey: 'vaapi' }, { codec: 'h264_mediacodec', featureKey: 'mediacodec' }, { codec: 'libx264' },]);
Select the first available codec from a priority list. Useful for graceful degradation: try hardware first, fall back to software.