/*! * 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 { AppendOnlyStreamTarget } from 'mediabunny'; /** * Options for {@link RtmpTarget}. * * @group \@mediabunny/server * @public */ export type RtmpTargetOptions = Record; /** * An {@link https://mediabunny.dev/guide/writing-media-files#target | output target} that publishes over * RTMP, the counterpart to {@link RtmpSource}. * * RTMP carries FLV, which this library does not mux, so the target takes the **fragmented MP4** an * `Output` writes and remuxes it: `new Mp4OutputFormat({ fastStart: 'fragmented' })`, whose empty * `moov` is what lets the stream be read before it ends. A non-fragmented format cannot be published, * since its `moov` is only written at the end. * * The connection opens on the first write, so constructing one never blocks, and a server that drops * the publish ends the stream rather than erroring — reconnecting is the caller's, by building a new * `Output`. * * @example * ```ts * const output = new Output({ * format: new Mp4OutputFormat({ fastStart: 'fragmented' }), * target: new RtmpTarget('rtmp://server/live/streamkey'), * }); * ``` * * @group \@mediabunny/server * @public */ export declare class RtmpTarget extends AppendOnlyStreamTarget { constructor(url: string, options?: RtmpTargetOptions); /** Packets published so far, which stays 0 until the server has taken the first one. */ get publishedPackets(): number; } //# sourceMappingURL=rtmp-target.d.ts.map