Skip to content

@seydx/rtsp / installNativeLogging

Function: installNativeLogging()

installNativeLogging(logger, options?): NativeLoggingHandle

Defined in: native-logging.ts:72

Bridge FFmpeg's internal logging into a Logger.

node-av embeds FFmpeg in-process, and FFmpeg's av_log callback is a single process-global slot. This installs that one callback and routes each message to the given logger by severity, instead of letting FFmpeg print to stderr. Call it once per process (e.g. at a worker/plugin bootstrap) with the process's logger — not per stream/relay, since a later call replaces the previous bridge.

Because every forked process has its own FFmpeg instance, separate processes are already isolated; this simply captures the FFmpeg output of the current process.

Parameters

logger

Logger

Destination logger; messages are mapped error/warn → error/warn, everything else → debug.

options?

NativeLoggingOptions = {}

Verbosity ceiling and extra ignore patterns.

Returns

NativeLoggingHandle

A handle whose dispose() restores FFmpeg's default logging.

Example

typescript
import { installNativeLogging } from '@seydx/rtsp';

const logging = installNativeLogging(myLogger);
// ...on shutdown
logging.dispose();