/** * H264Encoder — Wraps WebCodecs VideoEncoder to transcode YUV frames to H.264. * * Pipeline: HEVCFrame (Uint16Array YUV planes) → VideoFrame(I420) → VideoEncoder → EncodedVideoChunk */ import type { HEVCFrame } from "./types.js"; export interface H264EncoderConfig { width: number; height: number; fps?: number; bitrate?: number; } export interface EncodedChunk { data: Uint8Array; timestamp: number; duration: number; isKeyframe: boolean; } export declare class H264Encoder { private _encoder; private _width; private _height; private _fps; private _codecDescription; /** Callback invoked for each encoded chunk */ onChunk: ((chunk: EncodedChunk) => void) | null; /** Callback invoked when codec description (avcC) is available */ onCodecDescription: ((desc: Uint8Array) => void) | null; constructor(config: H264EncoderConfig); /** Get the H.264 codec string used by this encoder */ get codec(): string; /** Get the avcC codec description (available after first keyframe) */ get codecDescription(): Uint8Array | null; /** * Encode a decoded HEVC frame. * Converts Uint16Array YUV planes to I420 Uint8Array, creates VideoFrame, encodes. */ encode(frame: HEVCFrame, timestampUs: number, keyFrame?: boolean): void; /** Flush the encoder — waits for all pending chunks to be output */ flush(): Promise; /** Close the encoder and release resources */ close(): void; /** Check if VideoEncoder is supported in the current environment */ static isSupported(): boolean; /** * Async capability probe — checks that VideoEncoder can actually encode H.264. * Firefox exposes VideoEncoder but may not support H.264 encoding. * Returns false if the API is missing or the config is not supported. */ static checkSupport(): Promise; private _handleOutput; } //# sourceMappingURL=h264-encoder.d.ts.map