2022-11-02 14:36:09 +03:00
---
id: restream
title: Restream
---
2023-01-30 02:22:40 +03:00
## RTSP
2022-11-02 14:36:09 +03:00
2023-01-13 16:18:15 +03:00
Frigate can restream your video feed as an RTSP feed for other applications such as Home Assistant to utilize it at `rtsp://<frigate_host>:8554/<camera_name>` . Port 8554 must be open. [This allows you to use a video feed for detection in Frigate and Home Assistant live view at the same time without having to make two separate connections to the camera ](#reduce-connections-to-camera ). The video feed is copied from the original video feed directly to avoid re-encoding. This feed does not include any annotation by Frigate.
2022-11-02 14:36:09 +03:00
2025-09-25 14:15:04 +03:00
Frigate uses [go2rtc ](https://github.com/AlexxIT/go2rtc/tree/v1.9.10 ) to provide its restream and MSE/WebRTC capabilities. The go2rtc config is hosted at the `go2rtc` in the config, see [go2rtc docs ](https://github.com/AlexxIT/go2rtc/tree/v1.9.10#configuration ) for more advanced configurations and features.
2022-12-31 17:54:10 +03:00
2023-02-09 06:26:38 +03:00
:::note
2024-06-02 15:48:28 +03:00
You can access the go2rtc stream info at `/api/go2rtc/streams` which can be helpful to debug as well as provide useful information about your camera streams.
2023-02-09 06:26:38 +03:00
:::
2023-01-30 02:22:40 +03:00
### Birdseye Restream
2022-12-31 17:54:10 +03:00
2023-08-20 00:20:43 +03:00
Birdseye RTSP restream can be accessed at `rtsp://<frigate_host>:8554/birdseye` . Enabling the birdseye restream will cause birdseye to run 24/7 which may increase CPU usage somewhat.
2023-11-09 15:43:06 +03:00
2023-08-20 00:20:43 +03:00
```yaml
birdseye:
2024-09-12 03:53:58 +03:00
restream: True
2023-08-20 00:20:43 +03:00
```
2023-01-04 04:24:34 +03:00
2025-10-19 14:20:36 +03:00
:::tip
To improve connection speed when using Birdseye via restream you can enable a small idle heartbeat by setting `birdseye.idle_heartbeat_fps` to a low value (e.g. `1– 2` ). This makes Frigate periodically push the last frame even when no motion is detected, reducing initial connection latency.
:::
2023-01-30 02:22:40 +03:00
### Securing Restream With Authentication
The go2rtc restream can be secured with RTSP based username / password authentication. Ex:
```yaml
go2rtc:
rtsp:
username: "admin"
password: "pass"
2023-11-09 15:43:06 +03:00
streams: ...
2023-01-30 02:22:40 +03:00
```
**NOTE:** This does not apply to localhost requests, there is no need to provide credentials when using the restream as a source for frigate cameras.
2022-11-19 16:15:20 +03:00
## Reduce Connections To Camera
Some cameras only support one active connection or you may just want to have a single connection open to the camera. The RTSP restream allows this to be possible.
### With Single Stream
One connection is made to the camera. One for the restream, `detect` and `record` connect to the restream.
```yaml
2023-01-17 02:50:35 +03:00
go2rtc:
streams:
2023-09-21 15:52:46 +03:00
name_your_rtsp_cam: # < - for RTSP streams
2023-01-19 02:50:06 +03:00
- rtsp://192.168.1.5:554/live0 # < - stream which supports video & aac audio
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_rtsp_cam#audio=opus" # < - copy of the stream which transcodes audio to the missing codec ( usually will be opus )
name_your_http_cam: # < - for other streams
2023-01-26 03:35:27 +03:00
- http://192.168.50.155/flv?port=1935& app=bcs& stream=channel0_main.bcs& user=user& password=password # < - stream which supports video & aac audio
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_http_cam#audio=opus" # < - copy of the stream which transcodes audio to the missing codec ( usually will be opus )
2023-01-17 02:50:35 +03:00
2022-11-19 16:15:20 +03:00
cameras:
2023-09-21 15:52:46 +03:00
name_your_rtsp_cam:
2022-11-19 16:15:20 +03:00
ffmpeg:
2023-01-15 18:40:42 +03:00
output_args:
2023-01-17 02:50:35 +03:00
record: preset-record-generic-audio-copy
2022-11-19 16:15:20 +03:00
inputs:
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_rtsp_cam # < --- the name here must match the name of the camera in restream
2023-01-19 02:50:06 +03:00
input_args: preset-rtsp-restream
roles:
- record
- detect
2023-07-01 16:18:33 +03:00
- audio # < - only necessary if audio detection is enabled
2023-09-21 15:52:46 +03:00
name_your_http_cam:
2023-01-19 02:50:06 +03:00
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_http_cam # < --- the name here must match the name of the camera in restream
2023-01-15 18:40:42 +03:00
input_args: preset-rtsp-restream
2022-11-19 16:15:20 +03:00
roles:
- record
- detect
2023-07-01 16:18:33 +03:00
- audio # < - only necessary if audio detection is enabled
2022-11-19 16:15:20 +03:00
```
2023-01-19 17:14:38 +03:00
### With Sub Stream
2022-11-19 16:15:20 +03:00
Two connections are made to the camera. One for the sub stream, one for the restream, `record` connects to the restream.
```yaml
2023-01-17 02:50:35 +03:00
go2rtc:
streams:
2023-09-21 15:52:46 +03:00
name_your_rtsp_cam:
2023-01-19 02:50:06 +03:00
- rtsp://192.168.1.5:554/live0 # < - stream which supports video & aac audio . This is only supported for rtsp streams , http must use ffmpeg
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_rtsp_cam#audio=opus" # < - copy of the stream which transcodes audio to opus
name_your_rtsp_cam_sub:
2023-01-19 02:50:06 +03:00
- rtsp://192.168.1.5:554/substream # < - stream which supports video & aac audio . This is only supported for rtsp streams , http must use ffmpeg
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_rtsp_cam_sub#audio=opus" # < - copy of the stream which transcodes audio to opus
name_your_http_cam:
2023-01-26 03:35:27 +03:00
- http://192.168.50.155/flv?port=1935& app=bcs& stream=channel0_main.bcs& user=user& password=password # < - stream which supports video & aac audio . This is only supported for rtsp streams , http must use ffmpeg
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_http_cam#audio=opus" # < - copy of the stream which transcodes audio to opus
name_your_http_cam_sub:
2023-01-26 03:35:27 +03:00
- http://192.168.50.155/flv?port=1935& app=bcs& stream=channel0_ext.bcs& user=user& password=password # < - stream which supports video & aac audio . This is only supported for rtsp streams , http must use ffmpeg
2023-09-21 15:52:46 +03:00
- "ffmpeg:name_your_http_cam_sub#audio=opus" # < - copy of the stream which transcodes audio to opus
2023-01-17 02:50:35 +03:00
2022-11-19 16:15:20 +03:00
cameras:
2023-09-21 15:52:46 +03:00
name_your_rtsp_cam:
2023-01-19 02:50:06 +03:00
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_rtsp_cam # < --- the name here must match the name of the camera in restream
2023-01-19 02:50:06 +03:00
input_args: preset-rtsp-restream
roles:
- record
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_rtsp_cam_sub # < --- the name here must match the name of the camera_sub in restream
2023-01-19 02:50:06 +03:00
input_args: preset-rtsp-restream
roles:
2023-07-01 16:18:33 +03:00
- audio # < - only necessary if audio detection is enabled
2023-01-19 02:50:06 +03:00
- detect
2023-09-21 15:52:46 +03:00
name_your_http_cam:
2022-11-19 16:15:20 +03:00
ffmpeg:
2023-01-15 18:40:42 +03:00
output_args:
2023-01-17 02:50:35 +03:00
record: preset-record-generic-audio-copy
2022-11-19 16:15:20 +03:00
inputs:
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_http_cam # < --- the name here must match the name of the camera in restream
2023-01-15 18:40:42 +03:00
input_args: preset-rtsp-restream
2022-11-19 16:15:20 +03:00
roles:
- record
2023-09-21 15:52:46 +03:00
- path: rtsp://127.0.0.1:8554/name_your_http_cam_sub # < --- the name here must match the name of the camera_sub in restream
2023-01-17 02:50:35 +03:00
input_args: preset-rtsp-restream
2022-11-19 16:15:20 +03:00
roles:
2023-07-01 16:18:33 +03:00
- audio # < - only necessary if audio detection is enabled
2022-11-19 16:15:20 +03:00
- detect
```
2023-01-19 17:14:38 +03:00
2024-12-05 01:54:57 +03:00
## Handling Complex Passwords
2025-03-12 21:54:20 +03:00
go2rtc expects URL-encoded passwords in the config, [urlencoder.org ](https://urlencoder.org ) can be used for this purpose.
2024-12-05 01:54:57 +03:00
For example:
```yaml
go2rtc:
streams:
my_camera: rtsp://username:$@foo%@192.168.1.100
```
becomes
```yaml
go2rtc:
streams:
my_camera: rtsp://username:$%40foo%25@192.168.1.100
```
2025-04-20 00:49:52 +03:00
See [this comment ](https://github.com/AlexxIT/go2rtc/issues/1217#issuecomment-2242296489 ) for more information.
2024-12-05 01:54:57 +03:00
2023-01-19 17:14:38 +03:00
## Advanced Restream Configurations
2025-09-25 14:15:04 +03:00
The [exec ](https://github.com/AlexxIT/go2rtc/tree/v1.9.10#source-exec ) source in go2rtc can be used for custom ffmpeg commands. An example is below:
2023-01-19 17:14:38 +03:00
NOTE: The output will need to be passed with two curly braces `{{output}}`
```yaml
go2rtc:
streams:
stream1: exec:ffmpeg -hide_banner -re -stream_loop -1 -i /media/BigBuckBunny.mp4 -c copy -rtsp_transport tcp -f rtsp {{output}}
2025-10-19 14:20:36 +03:00
```