/** * Video Encoder - Encode captured frames to video (WebM/MP4) * * Uses the native MediaRecorder API for encoding. * WebM is widely supported, MP4 requires browser support. * * @example * ```typescript * const frames = await capture.captureAnimation(...); * const video = await encodeVideo(frames, { * width: 800, * height: 600, * fps: 30, * format: 'webm', * }, (percent) => console.log(`Encoding: ${percent}%`)); * * // Download the video * downloadBlob(video, 'animation.webm'); * ``` */ import type { CapturedFrame } from './frame-capture'; export interface VideoOptions { /** Output width in pixels */ width: number; /** Output height in pixels */ height: number; /** Frames per second */ fps: number; /** Video format */ format: 'webm' | 'mp4'; /** Video bitrate in bits per second (default: 5Mbps) */ bitrate?: number; /** Video codec (default: auto-select based on format) */ codec?: string; } export interface VideoEncoderSupport { webm: boolean; mp4: boolean; codecs: string[]; } /** * Check browser support for video encoding */ export declare function checkVideoEncoderSupport(): VideoEncoderSupport; /** * Encode frames to video using canvas-based approach * * @param frames - Array of captured frames * @param options - Video encoding options * @param onProgress - Progress callback (0-100) * @returns Blob containing the video */ export declare function encodeVideo(frames: CapturedFrame[], options: VideoOptions, onProgress?: (percent: number) => void): Promise; /** * Encode video using WebCodecs API (more efficient, but less browser support) * Falls back to MediaRecorder if WebCodecs not available */ export declare function encodeVideoWebCodecs(frames: CapturedFrame[], options: VideoOptions, onProgress?: (percent: number) => void): Promise; /** * Helper function to download a blob */ export declare function downloadVideoBlob(blob: Blob, filename: string): void; /** * Get estimated file size for video */ export declare function estimateVideoSize(durationMs: number, bitrate?: number): number; /** * Get recommended bitrate based on resolution */ export declare function getRecommendedBitrate(width: number, height: number): number; //# sourceMappingURL=video-encoder.d.ts.map