Publishing RTMP with a stream key¶
media.publish.rtmp_streamkey
The key selects a stream and authorizes incoming RTMP publishing. Publishing is denied without rtmp_streamkey, even if the stream explicitly declares a publish input.
Purpose¶
The encoder needs the server address and key; it does not send the stream name in the publish command. Connect to the server configured to receive this stream. Automatic routing of publications between servers is not implemented.
Difference from basic publishing¶
The key provides authorization and stream selection for RTMP publishing. Transport and codecs stay the same.
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.
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.
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.
Next steps¶
Transport¶
RTMP over TCP. The key is sent as the publish name; it does not encrypt the transport.
Supported codecs¶
The same as RTMP publishing.