Skip to content

Publishing RTMP

media.publish.rtmp

The source connects to Sapsan and sends the stream. This is publishing; client capture from a remote server belongs to media.ingest.

Configuration

In the console, open the stream, add an explicit Publish input at the desired position, and set its key in the input card. Enter a key manually or click Regenerate key: at least 5 Latin letters, digits or ._-. The setting is inputs[index].publish.rtmp_streamkey; setting a key does not add or reorder inputs. There is no upper length limit. Regeneration creates a random 10-character key.

The field hides the key. Use the copy button to configure the encoder; the eye temporarily reveals the value.

listeners:
  rtmp:
  - port: 1935
streams:
- name: studio
  inputs:
  - publish:
      rtmp_streamkey: Abc012._-Z

In OBS, set the server to rtmp://server:1935 and the key to Abc012._-Z. With the central API, use PATCH /central/api-v4/streams/configs/studio with body {"inputs":[{"publish":{"rtmp_streamkey":"Abc012._-Z"}}]}. The inputs array is replaced as a whole: include all other inputs in order, with every setting and secret.

When a working source precedes publish, the RTMP or SRT encoder is accepted as standby. Once the primary recovers through the clean window, the encoder stays connected as standby. A second encoder is rejected, even while the first is standby or has not sent usable frames. Switching to video publishing waits for the next keyframe; audio-only waits for a usable audio frame. Existing source and transport timeouts apply.

Authentication

The key authorizes RTMP publishing to the single explicit publish input. Without a key, including publish: {}, RTMP is denied; the stream name does not replace the secret. Central atomically validates uniqueness across the current cluster configuration, including disabled streams. Used-key history is not stored. Validation rejects a second publish input and publish inside MBR.

After applying a changed or cleared key, the server disconnects the current RTMP publisher and rejects the previous key. Clearing rtmp_streamkey: null keeps the publish input. Changing the RTMP key preserves SRT publishing; other configuration changes preserve the RTMP connection when its key is unchanged.

Transport

RTMP over TCP. The sender connects to the shared server RTMP listener.

Supported codecs

  • H.264
  • HEVC (Enhanced RTMP, hvc1)
  • AV1 (Enhanced RTMP, av01)
  • AAC
  • MP3

RTMP carries FLV messages; Enhanced RTMP identifies video codecs by FourCC. The list describes receiving compressed frames and passing them into the pipeline. AV1 requires Enhanced RTMP with av01; selecting AV1 at the sender without this packaging is insufficient. MP3 is accepted as FLV audio, separately from AAC.

Error handling

A stream accepts one active publication at a time. When the connection ends, the source becomes unavailable and shared failover rules apply. The sender initiates reconnection.

Next steps