> For the complete documentation index, see [llms.txt](https://gsfcorp.gitbook.io/macula/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gsfcorp.gitbook.io/macula/administration-guide-v1.33.0/rtsp-streaming-server.md).

# RTSP Streaming Server

Sometimes, you must provide a live stream from the camera to the third-party software or a remote system without giving access to the Macula itself.

It is possible with the Macula RTSP streaming server. This chapter will guide you through enabling the streaming server and setting streaming for the specific channel inside the client.

You will need to:

1. Enable RTSP streaming inside Macula.
2. Add permission for the remote user to access this stream.
3. Provide the correctly formed streaming link to the client.

#### Enabling the RTSP Streaming Server

The first step is to allow Macula to stream video over RTSP. To do so, go to:

1. *Macula -> Configuration -> Servers*
2. Select the server you want to stream from and double-click it, or locate the *Edit* button at the top of the *Server* subsection and click it - this must bring the selected *Server settings* pop-up window.
3. In the left subsection of that pop-up window, locate and click the *Connections* tab, scroll to the bottom of the right subsection, and find an input field named the *RTSP port* at the very bottom of the subsection.

The default value for the *RTSP port* input field is 0, which means streaming is disabled. To enable streaming, you need to provide the port number.

The ports that the Macula may already occupy, so you should avoid them:

* 8080 - standard HTTP port,
* 8082/83 or 8090/92 - may be occupied by external analytics,
* 554 - standard RTSP port may be occupied by the for other purposes

The recommended port is 8554. Since the Macula does not use this port, this must help avoid conflicts.

<figure><img src="https://412599993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeNXnJx0OpvxnmpWqOBNm%2Fuploads%2Fb3WMEAGNtFKVdfiGpAdb%2Fimage.png?alt=media&amp;token=7cbf60b5-60d5-4d93-805c-8a32341e9659" alt=""><figcaption></figcaption></figure>

After providing the port, confirm your selection with the *Apply* and *OK* buttons. After that, your *RTSP Streaming Server* is enabled.

{% hint style="danger" %}
If the streaming server does not start after port is enabled, for some configurations it may be necessary to restart your Macula server after adding the port.
{% endhint %}

#### Providing Permissions to the Remote User

The server is already streaming, but you must grant permission to access the stream. To do so, go to:

1. *Configuration -> Users*, pick a user you want to provide access to the *RTSP stream* and double click it or locate the *Edit* button on top of the *Users* subsection and click it.
2. Inside the new pop-up window, select *Administration profile*. Find the *Login via RTSP* checkbox under the *Client permissions* section and mark it.

<figure><img src="https://412599993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeNXnJx0OpvxnmpWqOBNm%2Fuploads%2FAHgPRKgeTNiepSMWPGiM%2Fimage.png?alt=media&amp;token=9138710c-a08d-4018-9ce6-5808cc359509" alt=""><figcaption></figcaption></figure>

Now, you can access the *RTSP stream* by providing the login and password to the client software you want to use to watch that stream. More details on *Users* can be found in the corresponding manual section.

#### Forming Streaming Link

The way you form the link to the stream will depend on the client you use to watch the stream, but for any configuration, you will need to know:

1. Streaming server IP address
2. Port, you assigned for the RTSP streaming
3. *Channel ID* you want to stream (You can find it under *Configuration -> Channels*, *ID* column)

<figure><img src="https://412599993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeNXnJx0OpvxnmpWqOBNm%2Fuploads%2FH4mdfhgUHLJcSxv7ogQT%2Fimage.png?alt=media&amp;token=f0d6761d-d8f7-4f9f-80c3-3f220ba1c7f2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you do not see the *ID* column inside the *Channels*, find the "hamburger" menu at the top-left side of the *Macula Console*, find the *Settings,* and mark the *Show object's IDs* checkbox.
{% endhint %}

Link template:

* rtsp\://user:password\@Server\_IP:RTSP\_port/channel\_ID/live/stream\_type (main or substream)

Link examples:

* rtsp\://@127.0.0.1:8554/130/live/main
* rtsp\://user:password\@127.0.0.1:8554/130/live/main
* rtsp\://user:password\@127.0.0.1:8554/130/live/substream

If you want to share the stream outside your local network, you must set port forwarding for the port you like to use for streaming. Please consult your network administrator for such cases.
