import type { BatchThumbnailOptions, EncoderCaps, FlipAxis, FrameDrawer, MetadataSpec, ThumbnailOptions, VideoInfo } from './nitro/VideoPipeline.nitro'; import { type Overlay } from './overlay'; import type { AudioSpec, ComposeSpec, DurationSpec, RenderOptions, RenderSpec, SynthesizeOutputSpec } from './types'; export interface TrimOptions extends RenderOptions { startSec: number; durationSec: number; outPath: string; } export interface FlipOptions extends RenderOptions { outPath: string; axis: FlipAxis; } /** At least one of `watermark` or `metadata` is required. */ export type StampOptions = { outPath: string; } & RenderOptions & ({ watermark: Overlay; metadata?: MetadataSpec; } | { watermark?: Overlay; metadata: MetadataSpec; }); export interface ComposeOptions extends RenderOptions { drawFrame: FrameDrawer; } export interface SynthesizeOptions extends RenderOptions { output: SynthesizeOutputSpec; duration: DurationSpec; drawFrame: FrameDrawer; audio?: AudioSpec; metadata?: MetadataSpec; } export declare const Video: { /** Probe a video and return its container/codec/dimension metadata. */ readonly info: (uri: string) => Promise; /** Extract a single JPEG frame at `atSec` and write it to `outPath`. */ readonly thumbnail: (uri: string, options: ThumbnailOptions) => Promise; /** * Extract N JPEG frames in a single native decode session — the right * primitive for filmstrips / scrubbers. `options.atSecs` and * `options.outPaths` are parallel arrays; resolves to one path per requested * time, in `atSecs` order. A frame that fails to extract resolves to an * empty string in its slot (the rest of the strip still resolves). */ readonly thumbnails: (uri: string, options: BatchThumbnailOptions) => Promise; /** Cached encoder capability snapshot (codecs, max dims, HDR, …). */ readonly capabilities: () => Promise; /** * Lossless-cut a single clip — always remux, never re-encode. To trim *and* * transform (rotate/flip/crop) in one pass, use {@link Video.render}, whose * native router picks remux vs transcode uniformly across platforms. */ readonly trim: (uri: string, options: TrimOptions) => Promise; /** Rotation-flag remux when the container supports it; transcode fallback otherwise. */ readonly flip: (uri: string, options: FlipOptions) => Promise; /** Auto-routed: metadata-only stamp uses remux; watermark falls into transcode. */ readonly stamp: (uri: string, options: StampOptions) => Promise; /** Single source of truth for native remux / transcode — auto-routed natively. */ readonly render: (spec: RenderSpec, options?: RenderOptions) => Promise; /** * Sugar for the worklet `compose` path: the `drawFrame` you pass crosses * the Nitro boundary as a callback and is invoked by the native pump per * frame with a live `FrameTarget` HybridObject. */ readonly compose: (spec: ComposeSpec, options: ComposeOptions) => Promise; /** * Null-input compose: no source clips, the entire frame stream is produced * by `drawFrame`. `output.width`, `output.height`, `output.fps` and * `duration` are all required (see §9 routing rules). */ readonly synthesize: (options: SynthesizeOptions) => Promise; }; //# sourceMappingURL=video.d.ts.map