Skip to content

RTMP server

An input type that allows Smelter to receive streams over RTMP.

Smelter exposes an RTMP endpoint after you register the input by sending a register-input request.

Media TypeSupported Codecs
VideoH.264, VP8*, VP9*
AudioAAC, Opus*
* E-RTMP feature.

The RTMP connection is configured using the following parameters:

  • The Smelter server address
  • The configured RTMP port - defaults to 1935, configurable via SMELTER_RTMP_SERVER_PORT
  • The id the input was registered under (used as the RTMP application name)
  • The registered stream_key

Most RTMP clients accept connection parameters in the form of a URL.
Format: rtmp[s]://<smelter_ip>:<port>/<input_id>/<stream_key>

Usage

To use an RTMP server input you must register it first. You can do it by sending a request like this:

Example request

POST: /api/input/example/register
Content-Type: application/json
{
"type": "rtmp_server",
"stream_key": "mykey"
}

See HTTP Routes documentation to learn more about managing inputs.

Once the RTMP server input is registered and Smelter is listening on the configured URL, you can push a stream to it using any RTMP client (e.g. OBS, FFmpeg) — for the example above, stream to rtmp://127.0.0.1:1935/example/mykey.

Reference

Type definition

type RtmpServerInput = {
type: "rtmp_server";
stream_key: string;
required?: bool;
decoder_map?: DecoderMap;
side_channel?: SideChannel;
}

Parameters for registering an RTMP server input.

Properties

stream_key

The RTMP stream key a publisher must use to connect to this input.

  • Type: string

required

Determines if the input stream is essential for output frame production. If set to true and the stream is delayed, Smelter will postpone output frames until the stream is received.

  • Type: bool
  • Default value: false

decoder_map

Assigns which decoder should be used for media encoded with a specific codec. Currently, more than one decoder is supported only for H264.


side_channel

Enable side channel publishing for this input. The external consumer reads decoded frames / audio from a Unix socket created under SMELTER_SIDE_CHANNEL_SOCKET_DIR.

DecoderMap

Maps codecs to the provided decoders.

Type definitions

type DecoderMap = {
h264?: 'ffmpeg_h264' | 'vulkan_h264';
};

Properties

h264

H264 decoder configuration.

  • Type: 'ffmpeg_h264' | 'vulkan_h264'
  • Default value: If available vulkan_h264 will be used, otherwise ffmpeg_h264
  • Supported values:
    • "ffmpeg_h264" - Software decoder based on FFmpeg.
    • "vulkan_h264" (Required feature: gpu-video ) - Hardware-accelerated decoder. Requires GPU that supports Vulkan Video decoding.

SideChannel

Per-track side channel configuration. See the Side Channel overview for details on how decoded data is exposed and consumed.

Type definition

type SideChannel = {
video?: bool;
audio?: bool;
delay_ms?: f64;
};

Properties

video

Publish decoded RGBA video frames for this input on the side channel.

  • Type: bool
  • Default value: false

audio

Publish decoded PCM audio batches for this input on the side channel.

  • Type: bool
  • Default value: false

delay_ms

Side channel delay in milliseconds. Frames are buffered for this duration ahead of when the queue consumes them, so the side-channel subscriber receives them early and has roughly this much time to process before the frame is due.

  • Type: f64
  • Default value: 0