# RTMP

The datarhei Core includes a simple RTMP server for publishing and playing streams. It is not enabled by default. You have to enable it in the config in the [rtmp section](/core/configuration/rtmp.md) or via the corresponding environemnt variables.

Example:

```
rtmp://127.0.0.1:1935/live/12345.stream
```

In the above example `/live` is the RTMP app and `12345.stream` is the name of the resource.

## Token

In order to protect access to the RTMP server you should define a token in the configuration. Only with a valid token it is possible to publish or play resources. The token has to be appended to the RTMP URL as a query string, e.g. `rtmp://127.0.0.1:1935/live/12345.stream?token=abc`.

As of version 16.12.0 you can write the token as last part of the path in URL instead of as a query string. The above example will looke like `rtmp://127.0.0.1:1935/live/12345.stream/abc`. This allows you to enter the token into the "stream key" field in some clients.

## API

Via the [RTMP endpoint](/core/api-rtmp/rtmp.md) in the API you can gather a list of the currently publishing RTMP resources.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datarhei.com/core/guides/rtmp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
