/** * Demuxer - FFmpeg-based demuxer using Asyncify for async I/O */ import type { SourceAdapter } from "../source/SourceAdapter"; import type { Track, VideoTrack, AudioTrack, SubtitleTrack, MediaInfo, Packet } from "../types"; import { WasmBindings, type MoviWasmModule } from "../wasm"; export declare class Demuxer { private source; private module; private bindings; private tracks; private duration; private isOpened; private wasmBinary?; private useNewWasmInstance; /** * @param source - Data source adapter * @param wasmBinary - Optional WASM binary * @param useNewWasmInstance - If true, creates isolated WASM instance (for preview pipeline) */ constructor(source: SourceAdapter, wasmBinary?: Uint8Array, useNewWasmInstance?: boolean); /** * Open the media file and parse metadata */ open(): Promise; /** * Enumerate all tracks */ private enumerateTracks; /** * Convert StreamInfo to Track */ /** * Convert StreamInfo to Track */ private convertStreamInfo; /** * Check if subtitle codec is image-based */ private isImageSubtitle; /** * Normalize FFmpeg color primaries to WebCodecs enum values */ private normalizeColorPrimaries; /** * Normalize FFmpeg color transfer to WebCodecs enum values */ private normalizeColorTransfer; /** * Normalize FFmpeg color matrix names to WebCodecs enum values */ private normalizeColorMatrix; /** * Get all tracks */ getTracks(): Track[]; /** * Get video tracks */ getVideoTracks(): VideoTrack[]; /** * Get audio tracks */ getAudioTracks(): AudioTrack[]; /** * Get subtitle tracks */ getSubtitleTracks(): SubtitleTrack[]; /** * Get extradata for a track */ getExtradata(trackId: number): Uint8Array | null; /** * Seek to timestamp (async due to Asyncify) */ seek(timestamp: number, flags?: number): Promise; /** * Read next packet (async due to Asyncify) */ readPacket(): Promise; /** * Get duration */ getDuration(): number; /** * Close and cleanup */ close(): void; /** * Extract embedded cover art (attached_pic) as the raw encoded image * bytes (jpeg / png), or null if the source has none. * * Runs in a short-lived, isolated WASM context — NOT the live playback * demuxer — so reading the artwork packet never moves the main read * position and can't disturb playback or seeking. The cover art is the * single keyframe of the still-image "video" stream, so readKeyframe(0) * returns its packet directly; no decode pass and no extra C exports * are needed (a dedicated movi_get_attached_pic_data export would shift * the WASM layout and trip a latent FFmpeg audio overflow — see project * memory "Album Art Crashes WASM"). Caller owns MIME-typing and decode * into an ImageBitmap. Best-effort: any failure resolves to null. */ static extractAttachedPicture(source: SourceAdapter, fileSize: number, wasmBinary?: Uint8Array): Promise; getBindings(): WasmBindings | null; getModule(): MoviWasmModule | null; } //# sourceMappingURL=Demuxer.d.ts.map