/**
 * Shared FFmpeg process runner.
 *
 * Extracts the repeated spawn-stderr-timeout-abort-close-error pattern
 * that appears across audioMixer and chunkEncoder into a single helper.
 */
import { type ManagedProcessTerminationReason } from "./managedChildProcess.js";
export interface RunFfmpegOptions {
    signal?: AbortSignal;
    timeout?: number;
    onStderr?: (line: string) => void;
}
export interface RunFfmpegResult {
    success: boolean;
    exitCode: number | null;
    stderr: string;
    durationMs: number;
    terminationReason: ManagedProcessTerminationReason;
    error?: Error;
}
/**
 * Build a user-facing error message for a failed ffmpeg invocation.
 *
 * Historically we reported only `FFmpeg exited with code N`, which is useless
 * for diagnosing encoder-options failures — a rejected `-preset` surfaces as a
 * bare `code -22` with no hint at which argument ffmpeg objected to. Including
 * the tail of stderr turns those into a one-line signal (e.g.
 * `Error applying encoder options: Invalid argument`) that tells the caller
 * exactly which option to fix.
 */
export declare function formatFfmpegError(exitCode: number | null, stderr: string, tailLines?: number): string;
export declare function runFfmpeg(args: string[], opts?: RunFfmpegOptions): Promise<RunFfmpegResult>;
//# sourceMappingURL=runFfmpeg.d.ts.map