/** Concatenate audio files using ffmpeg's concat demuxer. */ export declare function concatAudio(files: string[], output: string): Promise; /** Generate a silence MP3 of the given duration in seconds. */ export declare function generateSilence(duration: number, output: string): Promise; /** Extract an audio segment from a file by start/end times (seconds). */ export declare function extractAudioSegment({ endTime, input, output, startTime, }: { input: string; startTime: number; endTime: number; output: string; }): Promise; /** Extract the audio track from a video file and re-encode to MP3. */ export declare function extractVideoAudio(input: string, output: string): Promise; /** * Normalize audio to EBU R128 standard using ffmpeg-normalize. Returns the path * to the normalized file. Skips if already exists. */ export declare function normalizeAudio(input: string): Promise; /** * Source-of-truth for our standard H.264 / AAC video encode profile. Use these * named values when calling APIs that take typed options (e.g. Remotion's * `renderMedia`, which surfaces some flags as `codec` / `x264Preset` / `crf` / * `pixelFormat` / `audioCodec` / `audioBitrate`). For direct ffmpeg shell-out, * use the pre-flattened arg arrays below. * * The settings are tuned for concat-safe output: * * - `gop` of 30 puts a keyframe every 1s at 30fps, required for seekability and * `-c:v copy` concat * - `bFrames: 0` prevents non-monotonic DTS at concat seams * - `videoTrackTimescale` of 90000 matches Remotion's default timebase */ export declare const VIDEO_ENCODE_SETTINGS: { readonly videoCodec: "libx264"; /** * Value for Remotion's `codec` option (which uses short names, not ffmpeg * codec ids). */ readonly remotionCodec: "h264"; readonly crf: 23; readonly x264Preset: "medium"; readonly gop: 30; readonly bFrames: 0; readonly pixelFormat: "yuv420p"; readonly videoTrackTimescale: 90000; readonly audioCodec: "aac"; readonly audioSampleRate: 48000; readonly audioBitrate: "128k"; }; /** * Ffmpeg args for H.264 video encoding (concat-safe). Includes `-movflags * +faststart` so the muxed MP4 supports progressive HTTP playback. */ export declare const VIDEO_ENCODE_ARGS: string[]; /** Standard AAC audio encode args to pair with {@link VIDEO_ENCODE_ARGS}. */ export declare const VIDEO_AUDIO_ENCODE_ARGS: string[]; /** * Args for use inside Remotion's `ffmpegOverride` — just the flags that * `renderMedia`'s typed options don't surface natively. Currently only `-bf 0` * (no B-frames), which prevents non-monotonic DTS at concat seams between * Remotion-rendered clips and the B-frame-free training videos compressed by * {@link compressVideo}. Pair with the typed options fed from * {@link VIDEO_ENCODE_SETTINGS} for a render that matches our standard profile. * * Example: * * renderMedia({ * codec: VIDEO_ENCODE_SETTINGS.remotionCodec, * x264Preset: VIDEO_ENCODE_SETTINGS.x264Preset, * crf: VIDEO_ENCODE_SETTINGS.crf, * pixelFormat: VIDEO_ENCODE_SETTINGS.pixelFormat, * audioCodec: VIDEO_ENCODE_SETTINGS.audioCodec, * audioBitrate: VIDEO_ENCODE_SETTINGS.audioBitrate, * ffmpegOverride: ({ args }) => { * const out = args[args.length - 1] * const yflag = args[args.length - 2] * return [...args.slice(0, -2), ...VIDEO_REMOTION_OVERRIDE_ARGS, * yflag, out] * }, * ... * }) */ export declare const VIDEO_REMOTION_OVERRIDE_ARGS: string[]; /** * Compress a video using the standard H.264 settings. If `audio` is provided, * its track replaces the source video's audio. */ export declare function compressVideo({ input, output, audio, }: { input: string; output: string; audio?: string; }): Promise; /** * Mix narration audio with background music at a fixed volume ratio. Music is * trimmed to the shorter of the two inputs; if `targetDuration` is provided, * the output is padded with silence to match exactly. */ export declare function mixAudioWithMusic({ music, narration, output, targetDuration, }: { narration: string; music: string; output: string; targetDuration: number; }): Promise; /** Get the duration of an audio file in seconds using ffprobe. */ export declare function getDurationFromFile(file: string): Promise;