/** * Speed-ramp builder — piecewise-constant speed segments using ffmpeg's * setpts (video) and atempo / asetrate (audio). * * Why piecewise-constant: stock ffmpeg's setpts can take an `if(...)` chain * that switches PTS multiplier based on input time T. This is enough to * express the common "slow → fast → slow" cinematic ramp by stepping * through 2-3 segments. Smooth ramps (continuous interpolation) require * the `vfrdec` / `minterpolate` complex chain, which is out of v1 scope. * * Real-world reference for the setpts shape: scottcjn/bottube and several * VFXer scripts on GitHub. Confirmed against ffmpeg-filters man page. * * Mathematical model: * Each segment runs from points[i].atSec to points[i+1].atSec at speed * ((points[i].speed + points[i+1].speed) / 2). For >2 points we use the * LEFT speed within each segment (piecewise-constant) — easier to reason * about in the wild and matches what most tutorial code does. * * Video: PTS multiplier = 1 / speed → setpts=k*PTS where k = 1/speed. * Audio: atempo accepts 0.5..2 in one stage; we chain stages for wider * ranges. asetrate is faster but pitch-shifts; we don't use it for * voice content. */ export interface SpeedPoint { /** Absolute time in seconds in the input. */ atSec: number; /** * Speed multiplier from this point until the next. 1 = normal, * 0.5 = half speed (slow-mo), 2 = double speed. */ speed: number; } /** * Build the setpts expression for a piecewise-constant speed ramp. * * For points = [{atSec:0,speed:1},{atSec:2,speed:0.5},{atSec:5,speed:1}] * the output is: * setpts='if(lt(T,2),1*PTS,if(lt(T,5),2*PTS,1*PTS))' * * (k = 1/speed for each segment.) */ export declare function buildSetpts(points: SpeedPoint[]): string; /** * Build the audio-side filter chain. Returns null if every segment is * speed=1 (no-op). For >0.5 / <2 segments uses one atempo stage; for wider * ranges chains multiple stages (atempo's per-stage range is 0.5..2). * * Note: atempo is single-speed at a time. For piecewise ramps the fully * accurate path is to split the audio at each ramp boundary and process * each segment, then concat. We DON'T do that here — for the v1 scope this * function returns the AVERAGE atempo factor, with a flag the caller can * use to decide if a more complex split is needed. */ export declare function buildAtempo(points: SpeedPoint[]): { filter: string | null; stages: number; avgSpeed: number; }; //# sourceMappingURL=speed-ramp.d.ts.map