> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trurec.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a camera with a camera link

> Add each camera to TruRec AI with a camera link: its internet address, a port forwarded on your router, and a login. Each link is tested from our cloud before it's added.

On SaaS, you connect each camera with a **camera link**. TruRec AI uses the link to read the camera's video over the internet, from our cloud. You don't install anything at your site, but your router needs to forward a port. If your cameras record to an NVR or DVR, one port to the recorder covers every camera on it.

## What a camera link is

A camera link is the camera's RTSP address, as it's reached from the internet, with its login:

```text theme={null}
rtsp://viewer:the-camera-password@203.0.113.7:554/Streaming/Channels/102
```

| Part | Example | What it is |
| - | - | - |
| Type | `rtsp://` or `rtsps://` | How to connect. See [RTSP or RTSPS](#rtsp-or-rtsps). |
| Login | `viewer:the-camera-password` | The camera's username and password, with a `:` between them and an `@` after. Leave it out if the camera doesn't need one. |
| Address | `203.0.113.7` | Your site's internet address, or a hostname that points to it. Not the camera's address on your own network, such as `192.168.1.64`. |
| Port | `554` | The port your router forwards to the camera. If you leave it out, TruRec AI uses 554 for `rtsp://` and 322 for `rtsps://`. |
| Path | `/Streaming/Channels/102` | Which stream to read. It varies by brand and model, and it's the same path the camera uses on your own network. See [Find your camera's RTSP URL](https://docs.trurec.ai/getting-started/rtsp-urls.md). |

If the username or password contains anything other than letters and numbers, percent-encode those characters in the link. For example, write `@` as `%40`, `:` as `%3A`, `/` as `%2F`, `#` as `%23` and `?` as `%3F`.

## Before you start

* **Cameras that send H.264 or H.265 video.** When you test a link, the result shows each camera's video format.
* **Each camera's RTSP path and a login for it.** A [read-only login](https://docs.trurec.ai/getting-started/read-only-vms-user.md) is best. See [Find your camera's RTSP URL](https://docs.trurec.ai/getting-started/rtsp-urls.md).
* **Access to your router,** or to whoever looks after it, to forward a port. See [Ports and firewalls](https://docs.trurec.ai/networking/ports-and-firewalls.md).
* **Your site's public IP address.** If it changes from time to time, ask your internet provider for a static one. See [CGNAT and public IP addresses](https://docs.trurec.ai/networking/cgnat-and-public-ip.md#ask-your-provider). Whoever looks after your network can use a dynamic DNS name instead.

## Step 1: Forward a port

**If your cameras record to an NVR or DVR,** forward one port to the recorder. On your router, forward TCP outside port 554, or 8554 if your provider blocks 554, to the recorder's address, inside port 554. Then add a link for each channel. See [Set up port forwarding](https://docs.trurec.ai/networking/ports-and-firewalls.md#set-up-port-forwarding) and [Connect an NVR](https://docs.trurec.ai/getting-started/connect-an-nvr.md).

**If your cameras don't use a recorder,** forward a port to each camera instead. For example, forward port 554 to `192.168.1.64` port 554. With more than one camera, give each one its own outside port, such as 5541, 5542 and 5543, each forwarded to a different camera's port 554.

For a VMS, see [Connect a VMS](https://docs.trurec.ai/getting-started/connect-a-vms.md).

## Step 2: Add and test the links

**1. Open the cameras step**

In TruRec AI, open the **Cameras** step of setup. Under **Where are your cameras?**, choose **I'll add cameras individually**.

**2. Paste your links**

Paste one link per line under **Camera links, one per line**. You can add up to 16 at a time.

**3. Test them**

Choose **Test connection**. TruRec AI connects to each link from our cloud, and checks the camera answers, accepts the login and has a stream at that path. Each working link shows its video size and frame rate, such as `1920x1080 · 25 fps`, or **Connected** if the camera doesn't say. Each one that didn't work shows the reason underneath. See [If a link fails the test](#if-a-link-fails-the-test).

**4. Name them and connect**

Tick the working cameras to add. Each starts as **Camera 1**, **Camera 2** and so on: give each a clear name, such as `loading-bay-2`, because you'll see it on every alert. Then choose **Connect**, for example **Connect 2 cameras**. Only links that passed the test can be ticked.

![The Cameras step with I'll add cameras individually chosen and two links pasted. After Test connection, a green box says 1 of 2 links working. Camera 1 is ticked, shows 1920x1080 · 25 fps, and is named front-door. Camera 2 is unticked, with the reason: We couldn't reach it from the internet, or it didn't answer. The button reads Connect 1 camera.](https://mintcdn.com/trurec-ai-public-docs/9VQKp94LpB0n4hkt/images/getting-started/setup-cameras-links-tested.png?fit=max\&auto=format\&n=9VQKp94LpB0n4hkt\&q=85\&s=4c2f2c5ab9688ea7b016704b39a5d419)

Two camera links tested: 1 of 2 working. The first shows its video size and frame rate and has been named front-door; the second shows why it couldn't be reached.

Each camera shows **Receiving video** during setup, and **Healthy** on the Streams page, once its video arrives. If one doesn't, see [Camera health](https://docs.trurec.ai/streams/camera-health.md).

Each camera counts towards your plan. See [How camera pricing works](https://docs.trurec.ai/billing/how-camera-pricing-works.md).

## RTSP or RTSPS

* **`rtsp://`** works with almost every camera. The video isn't encrypted on its way to us, and if the camera uses a basic login, anyone listening in can read the login too.
* **`rtsps://`** encrypts the video on its way to us. Use it if your camera supports it.

> [!WARNING]
>
> **Known limitation:** with `rtsps://`, TruRec AI doesn't check the camera's certificate yet. Most cameras use a certificate they made themselves, which can't be checked against a trusted authority. So RTSPS stops someone who's only listening in from reading your video. It doesn't stop someone who can intercept the connection and pretend to be your camera: they could read the video and get the camera's login.

## Keep a port-forwarded camera safe

A forwarded port can be reached by anyone on the internet, not just TruRec AI. To protect it:

* **Use a read-only login with a strong password** that isn't used anywhere else. See [Create a read-only user](https://docs.trurec.ai/getting-started/read-only-vms-user.md).
* **Forward only the RTSP port.** Never forward the camera's or recorder's web page, or its admin ports.
* **Use `rtsps://`** if your camera supports it.
* **Keep the camera's firmware up to date.**

TruRec AI keeps each camera link, including its login, in your account, so it can read the video. See [Camera logins](https://docs.trurec.ai/privacy/data-retention.md#camera-logins). Never email a camera login to us.

## If a link fails the test

The test says why. The usual reasons:

| The test says | What to try |
| - | - |
| We couldn't reach it from the internet, or it didn't answer | Check the address and port, that the port is forwarded to the camera or recorder, and that it's on. If 554 doesn't work, try outside port 8554. Some connections can't accept incoming connections at all: see [CGNAT and public IP addresses](https://docs.trurec.ai/networking/cgnat-and-public-ip.md#how-to-tell) and [Two routers](https://docs.trurec.ai/networking/two-routers.md). |
| That address is private | The link has the camera's address on your own network, such as `192.168.x.x`. Use your site's internet address, and the port you forwarded. |
| This camera needs a login | Add the login to the link: `rtsp://username:password@…` |
| The camera turned down the login | Check the username and password, and that the user can view live video. |
| The camera answered, but there's no stream at that path | Check the path for your model. See [Find your camera's RTSP URL](https://docs.trurec.ai/getting-started/rtsp-urls.md). |
| Something answered, but it isn't a camera stream | The port is forwarded to something else, such as the camera's web page. Check the port. |
| The secure connection (rtsps) didn't work | Check the port. Not every camera supports RTSPS: try `rtsp://`. |
| We couldn't find that address | Check the spelling of the hostname. |

## Coming later: the TruRec connector

We're building the TruRec connector, a small program for a computer at your site. It sends your cameras' video out to TruRec AI, so you won't need to forward any ports. It isn't available yet. We'll announce it in the [changelog](https://docs.trurec.ai/changelog.md).

> [!NOTE]
>
> **On Enterprise:** how your cameras connect is planned with you. If TruRec AI runs in your own environment, it reads your cameras on your own network.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.