/** * The part of `ffprobe -print_format json -show_format -show_streams` that the app reads. * ffprobe prints most numbers as strings. */ export interface FfprobeStream { codec_type?: string; width?: number; height?: number; duration?: string; bit_rate?: string; avg_frame_rate?: string; side_data_list?: { side_data_type?: string; rotation?: number; }[]; tags?: Record; } export interface FfprobeFormat { duration?: string; bit_rate?: string; tags?: Record; } export interface FfprobeData { streams: FfprobeStream[]; format: FfprobeFormat; } export interface FFmpegRunOptions { /** Called with every line ffmpeg writes to stderr (ffmpeg writes all its output there). */ onStderrLine?: (line: string) => void; /** Called with the full command line before ffmpeg starts. */ onStart?: (cmd: string) => void; } /** * Thin wrapper over the ffmpeg and ffprobe executables. */ export declare class FFmpeg { /** stderr lines kept for the error message of a failed run */ private static readonly ERROR_LINES; static probe(file: string): Promise; static run(args: string[], options?: FFmpegRunOptions): Promise; /** * Splits each `'-option value'` (exactly two words) into two arguments, so config values like * `'-movflags +faststart'` work (fluent-ffmpeg did the same). */ static splitOptions(options?: string[]): string[]; private static spawn; }