/** * Standard H.264 video encoding params — matches the Python encoders * (`-r 24 -c:v libx264 -preset fast -crf 20`). Keeping these uniform across * every segment is what lets the 3h stitch step concat segments cleanly. */ export declare const STANDARD_VIDEO_ARGS: readonly string[]; /** * Standard AAC audio encoding params — matches the Python encoders * (`-c:a aac -ar 44100 -ac 2`). */ export declare const STANDARD_AUDIO_ARGS: readonly string[]; /** Resolve the ffmpeg binary: explicit opt > VCLAW_FFMPEG_BIN env > `ffmpeg`. */ export declare function resolveFfmpegBin(explicit?: string): string; /** Resolve the ffprobe binary: explicit opt > VCLAW_FFPROBE_BIN env > `ffprobe`. */ export declare function resolveFfprobeBin(explicit?: string): string; /** * Per-clip cut-at-N tail trim (WS9). Returns the ffmpeg `-t ` flag pair * when `maxSeconds` is a positive number, else `[]` (no trim). PURE — splice the * result into a per-clip ffmpeg arg array just before the output path. */ export declare function trimTailArgs(maxSeconds?: number): string[]; /** * Letterbox normalization filter (WS9). Scales the source to the canvas * `width` (preserving aspect via `-2`) and pads it onto a `width`x`height` * black canvas, producing cinematic bars. Mirrors the DHUAAN TITLEFIT pattern * (`scale=W:-2,pad=W:H:0:(oh-ih)/2:black`). Returns '' when no `ratio` is given * (an empty/undefined ratio disables the filter). PURE — no ffmpeg spawned. * * `ratio` is the target aspect ratio label (e.g. '2.39:1'); the actual letterbox * geometry comes from the `width`/`height` canvas the caller already targets. */ export declare function letterboxFilter(ratio: string | undefined, width: number, height: number): string; export interface RunFfmpegOptions { /** Build + return the command string without spawning ffmpeg. */ dryRun?: boolean; /** Override the ffmpeg binary (falls back to VCLAW_FFMPEG_BIN, then `ffmpeg`). */ ffmpegBin?: string; } export interface RunFfmpegResult { exitCode: number; stderr: string; /** The fully-resolved command line that was (or would be) run. */ command: string; } /** * Run ffmpeg with the given args. The `-y` flag (overwrite output without * prompting) is prepended automatically, mirroring the Python wrapper, so * callers never block on an interactive prompt. * * On `dryRun`, returns the command string without spawning (exitCode 0, * empty stderr). On a non-zero exit, throws `VclawError('ffmpeg_failed', ...)`. * * NOTE: This is the real-spawn path. Unit tests must use `dryRun: true` — we do * NOT run ffmpeg in tests. */ export declare function runFfmpeg(args: string[], opts?: RunFfmpegOptions): Promise; export interface FfprobeDurationOptions { /** Return 0 without spawning (dry-run friendly, mirrors callers). */ dryRun?: boolean; /** Override the ffprobe binary (falls back to VCLAW_FFPROBE_BIN, then `ffprobe`). */ ffprobeBin?: string; } /** * Probe a media file's duration, returned in **milliseconds**. * * Mirrors `FFmpegWrapper.probe(entries="format=duration")` + `get_duration`: * ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 * * On `dryRun`, returns 0 without spawning. Throws `VclawError('ffmpeg_failed', ...)` * if ffprobe fails or emits an unparseable duration. */ export declare function ffprobeDuration(path: string, opts?: FfprobeDurationOptions): Promise; export interface IsValidMp4Options { /** Override the ffprobe binary (falls back to VCLAW_FFPROBE_BIN, then `ffprobe`). */ ffprobeBin?: string; /** Probe timeout in ms; on expiry the probe is killed and false is returned. Default 15000. */ timeoutMs?: number; } /** * True iff ffprobe can read a positive duration from `path`. Catches * truncated/no-moov MP4s that pass existence+size checks but fail at * stitch. Ported from parallel_video_gen._ffprobe_is_valid_mp4. Never * throws — returns false on any probe failure / missing file / timeout. * * Mirrors the Python guard's args exactly: * ffprobe -v error -show_entries format=duration -of csv=p=0 * returning true only when ffprobe exits 0 AND stdout trims to a finite * number > 0. */ export declare function isValidMp4(path: string, opts?: IsValidMp4Options): Promise; //# sourceMappingURL=ffmpeg.d.ts.map