import type { VideoCodec } from 'mediabunny'; import { type RetryPolicy } from '@polotno/core/retry'; /** * mediabunny relays a "no" from `VideoEncoder.isConfigSupported` as this * error. Chrome answers that call by building the encoder on the spot — for * software H.264 that is OpenH264 spawning its thread pool — and says "no" * both for a codec the build lacks and for a thread the container could not * spare at that millisecond. Only asking again tells the two apart: on a * loaded render worker the answer flipped back to "yes" within two seconds * (cloud job Q6GsZoktESBZMQXQ, 2026-09-10). A browser with no WebCodecs at * all fails the same sentence, so it ends in the same no-encoder error. */ export declare function isEncoderUnavailable(error: unknown): error is Error; export interface OpenEncoderOptions extends RetryPolicy { /** Codecs in order of preference. */ codecs: readonly VideoCodec[]; /** One attempt on `codec`: open the pipeline and encode the first frame. */ attempt: (codec: VideoCodec) => Promise; /** * Cheap filter for the fallback codecs; never consulted for the preferred * one, whose proof is the attempt itself — see probeFallbackCodec. */ probe: (codec: VideoCodec) => Promise; } /** * Open a video encoder by encoding the first frame, retrying a codec the * browser reports unavailable before moving to the next one. A stable "no" * costs the shared retry budget; a transient one costs a short wait. Any * other failure propagates at once. */ export declare function openEncoder({ codecs, attempt, probe, ...policy }: OpenEncoderOptions): Promise; //# sourceMappingURL=encoder-open.d.ts.map