mediaforge - v2.2.0
    Preparing search index...

    Interface SpawnOptions

    interface SpawnOptions {
        binary: string;
        args: string[];
        parseProgress?: boolean;
        totalDurationUs?: number;
        cwd?: string;
        timeout?: number;
        signal?: AbortSignal;
        killGracePeriodMs?: number;
        killProcessGroup?: boolean;
        autoCleanup?: boolean;
        onDiagnostic?: DiagnosticHook;
        logger?: MediaForgeLogger;
        stdio?: {
            stdin?: "pipe" | "ignore" | "inherit";
            stdout?: "pipe" | "ignore" | "inherit";
            stderr?: "pipe" | "ignore" | "inherit";
        };
    }
    Index

    Properties

    binary: string

    Path to the ffmpeg binary

    args: string[]

    Full argument list

    parseProgress?: boolean

    If true, emit progress= events by parsing stderr key=value blocks

    totalDurationUs?: number

    Known total duration in microseconds (for percent calculation)

    cwd?: string

    Working directory for the spawned process

    timeout?: number

    Timeout in milliseconds. If exceeded, the process is killed and an error is emitted.

    signal?: AbortSignal

    Abort the encode from the outside.

    When the signal fires the child is killed with the same escalating sequence a timeout uses, and the process emits an FFmpegAbortError. A signal that is already aborted causes spawnFFmpeg to throw before any process is created, so a cancelled request never leaves a stray ffmpeg behind.

    killGracePeriodMs?: number

    Milliseconds to wait after SIGTERM before escalating to SIGKILL. Defaults to 2000. Set to 0 to kill immediately.

    Escalation is not optional in practice: a child that installs a SIGTERM handler (or ignores the signal) otherwise survives a cancel or a timeout indefinitely.

    killProcessGroup?: boolean

    Kill the child's entire process group rather than just the process. Defaults to true on POSIX, where it is what makes grandchildren die too. Ignored on Windows.

    autoCleanup?: boolean

    Register this child with the library's exit/SIGINT/SIGTERM cleanup so it cannot outlive the host process. Defaults to true.

    Turn it off only when the caller owns the child's lifetime.

    onDiagnostic?: DiagnosticHook

    Receives structured lifecycle events for this child.

    Emit a debug log line when the child starts.

    stdio?: {
        stdin?: "pipe" | "ignore" | "inherit";
        stdout?: "pipe" | "ignore" | "inherit";
        stderr?: "pipe" | "ignore" | "inherit";
    }

    How to wire the child's standard streams.

    Defaults to all pipes, which is what the event API needs. Override it when the caller manages the streams directly — notably a CLI piping ffmpeg's output to its own stdout, which must use inherit: a piped stdout nobody drains fills the 64 KiB OS buffer and deadlocks ffmpeg mid-encode.