Skip to content

@seydx/rtsp / AvSourceOptions

Interface: AvSourceOptions

Defined in: sources/av.ts:26

Options controlling how an AvSource opens and reads its input.

Every field is optional; the defaults are tuned for inherently live inputs such as RTSP cameras. Options that map onto libav demuxer settings (transport, timeout, format) are forwarded to node-av's Demuxer.open, while pacing and looping are applied by the source itself.

Properties

backchannel?

optional backchannel?: boolean

Defined in: sources/av.ts:83

Request the ONVIF backchannel (talkback) on an RTSP input.

When enabled, backchannel=1 is appended to the RTSP URL and, once the input is open, the camera's advertised send-only stream is exposed via BackchannelSource. If the camera advertises no backchannel, a warning is logged and the feature is silently unavailable.


format?

optional format?: string

Defined in: sources/av.ts:34

Force a specific input demuxer instead of relying on auto-detection.

Useful for raw or headerless inputs where libav cannot probe the container, for example h264 or mpegts. When omitted, the format is detected from the URL scheme and the input bytes.


logger?

optional logger?: Logger

Defined in: sources/av.ts:101

Optional logger for diagnostic output.

Receives debug messages when the input is opened and warnings or errors when the backchannel is missing or teardown fails. When omitted, the source runs silently.


loop?

optional loop?: boolean

Defined in: sources/av.ts:73

Reopen the input automatically when it reaches the end.

Enables looping a finite file or reconnecting a stream that terminates: after the input drains, the source closes and reopens it, continuing to yield packets on the same wall clock. When false (the default), the packet iterator completes once the input ends.


options?

optional options?: Record<string, string | number>

Defined in: sources/av.ts:92

Extra format-specific demuxer options passed straight through to libav.

Merged underneath the dedicated fields (AvSourceOptions.transport and AvSourceOptions.timeout take precedence over identically named keys here). Use this to set any libav option that has no first-class field.


readrate?

optional readrate?: number

Defined in: sources/av.ts:63

Throttle delivery to a multiple of real time, like ffmpeg's -re flag.

A value of 1 paces packets to the source's own timestamps, which is required to serve a non-realtime input (such as a file) as a live stream; larger values play faster than real time. Omit for inherently live inputs (e.g. RTSP), which already arrive at their natural rate.


timeout?

optional timeout?: number

Defined in: sources/av.ts:53

Open and read timeout in microseconds.

Passed through as the libav timeout (a.k.a. stimeout) option; the I/O layer aborts if no data arrives within this window. Note the unit is microseconds, so one second is 1_000_000. When omitted, libav blocks indefinitely.


transport?

optional transport?: "tcp" | "udp"

Defined in: sources/av.ts:43

Lower-layer transport used for RTSP inputs.

Shorthand for the rtsp_transport demuxer option: tcp is interleaved and firewall-friendly, udp lowers latency at the cost of possible packet loss. Ignored for non-RTSP inputs. When omitted, libav chooses its own default.