/*! * Copyright (c) 2026-present, Vanilagy and contributors * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { ReadableStreamSource } from 'mediabunny'; /** * Options for {@link RtmpSource}. * * @group \@mediabunny/server * @public */ export type RtmpSourceOptions = { /** * Whether to accept a publisher (`'listener'`) or dial out to one (`'caller'`). Defaults to * `'caller'`, so a URL names something to connect to unless listening is asked for. */ mode?: 'listener' | 'caller'; /** * Seconds to wait for a publisher to appear while listening. Defaults to 30. Never infinite: a wait * cannot be cancelled once started. * * Applies to `'listener'` mode only. rtmp's `timeout` option implies listen mode, so it cannot be * given to a caller without turning it into a listener; a caller's connect is bounded by the * protocol instead, at around five seconds. See FORK.md. */ connectTimeout?: number; /** * Seconds to wait for data from a connected publisher before ending the stream. Defaults to 30. */ readTimeout?: number; /** * Seconds of media per fMP4 fragment, defaulting to 0.5. Smaller means lower latency and more * container overhead. */ fragmentDuration?: number; /** Maximum bytes to keep for re-reads. Passed through to Mediabunny's `ReadableStreamSource`. */ maxCacheSize?: number; }; /** * A {@link https://mediabunny.dev/guide/reading-media-files#source | Source} that reads a live RTMP * stream, so an `Input` can read it like any other source. * * The FLV is remuxed to fragmented MP4 in process — no relay, no temporary files — and Mediabunny * demuxes the result. AVC and HEVC pass through without re-encoding. The socket is opened on the first * read, so constructing one never blocks. * * @example * ```ts * const input = new Input({ * source: new RtmpSource('rtmp://0.0.0.0:1935/live/key', { mode: 'listener' }), * formats: ALL_FORMATS, * }); * ``` * * @group \@mediabunny/server * @public */ export declare class RtmpSource extends ReadableStreamSource { constructor(url: string, options?: RtmpSourceOptions); } //# sourceMappingURL=rtmp-source.d.ts.map