Ultimate camera streaming application with support RTSP, WebRTC, HomeKit, FFmpeg, RTMP, etc.
- zero-dependency and zero-config small app for all OS (Windows, macOS, Linux, ARM)
- zero-delay for many supported protocols (lowest possible streaming latency)
- streaming from RTSP, RTMP, DVRIP, HTTP (FLV/MJPEG/JPEG/TS), USB Cameras and other sources
- streaming from any sources, supported by FFmpeg
- streaming to RTSP, WebRTC, MSE/MP4, HomeKit HLS or MJPEG
- publish any source to popular streaming services (YouTube, Telegram, etc.)
- first project in the World with support streaming from HomeKit Cameras
- support H265 for WebRTC in browser (Safari only, read more)
- on the fly transcoding for unsupported codecs via FFmpeg
- play audio files and live streams on some cameras with speaker
- multi-source 2-way codecs negotiation
- mixing tracks from different sources to single stream
- auto match client supported codecs
- 2-way audio for some cameras
- streaming from private networks via ngrok
- can be integrated to any smart home platform or be used as standalone app
Inspired by:
- series of streaming projects from @deepch
- webrtc go library and whole @pion team
- rtsp-simple-server idea from @aler9
- GStreamer framework pipeline idea
- MediaSoup framework routing idea
- HomeKit Accessory Protocol from @brutella
- creator of the project's logo @v_novoseltsev
- Fast start
- Configuration
- Module: Streams
- Two way audio
- Source: RTSP
- Source: RTMP
- Source: HTTP
- Source: ONVIF
- Source: FFmpeg
- Source: FFmpeg Device
- Source: Exec
- Source: Echo
- Source: Expr
- Source: HomeKit
- Source: Bubble
- Source: DVRIP
- Source: Tapo
- Source: Kasa
- Source: GoPro
- Source: Ivideon
- Source: Hass
- Source: ISAPI
- Source: Nest
- Source: Roborock
- Source: WebRTC
- Source: WebTorrent
- Incoming sources
- Stream to camera
- Publish stream
- Module: API
- Module: RTSP
- Module: RTMP
- Module: WebRTC
- Module: HomeKit
- Module: WebTorrent
- Module: ngrok
- Module: Hass
- Module: MP4
- Module: HLS
- Module: MJPEG
- Module: Log
- Module: Streams
- Security
- Codecs filters
- Codecs madness
- Codecs negotiation
- Projects using go2rtc
- Camera experience
- TIPS
- FAQ
Fast start
- Download binary or use Docker or Home Assistant Add-on or Integration
- Open web interface:
http://localhost:1984/
Optionally:
- add your streams to config file
- setup external access to webrtc
Developers:
- write your own web interface
- integrate web api into your smart home platform
go2rtc: Binary
Download binary for your OS from latest release:
go2rtc_win64.zip
- Windows 64-bitgo2rtc_win32.zip
- Windows 32-bitgo2rtc_win_arm64.zip
- Windows ARM 64-bitgo2rtc_linux_amd64
- Linux 64-bitgo2rtc_linux_i386
- Linux 32-bitgo2rtc_linux_arm64
- Linux ARM 64-bit (ex. Raspberry 64-bit OS)go2rtc_linux_arm
- Linux ARM 32-bit (ex. Raspberry 32-bit OS)go2rtc_linux_armv6
- Linux ARMv6 (for old Raspberry 1 and Zero)go2rtc_linux_mipsel
- Linux MIPS (ex. Xiaomi Gateway 3, Wyze cameras)go2rtc_mac_amd64.zip
- Mac Intel 64-bitgo2rtc_mac_arm64.zip
- Mac ARM 64-bit
Don't forget to fix the rights chmod +x go2rtc_xxx_xxx
on Linux and Mac.
go2rtc: Docker
The Docker container alexxit/go2rtc
supports multiple architectures including amd64
, 386
, arm64
, and arm
. This container offers the same functionality as the Home Assistant Add-on but is designed to operate independently of Home Assistant. It comes preinstalled with FFmpeg, ngrok, and Python.
go2rtc: Home Assistant Add-on
- Install Add-On:
- Settings > Add-ons > Plus > Repositories > Add
https://github.com/AlexxIT/hassio-addons
- go2rtc > Install > Start
- Settings > Add-ons > Plus > Repositories > Add
- Setup Integration
go2rtc: Home Assistant Integration
WebRTC Camera custom component can be used on any Home Assistant installation, including HassWP on Windows. It can automatically download and use the latest version of go2rtc. Or it can connect to an existing version of go2rtc. Addon installation in this case is optional.
go2rtc: Dev version
Latest, but maybe unstable version:
- Binary: latest nightly release
- Docker:
alexxit/go2rtc:master
oralexxit/go2rtc:master-hardware
versions - Hass Add-on:
go2rtc master
orgo2rtc master hardware
versions
Configuration
- by default go2rtc will search
go2rtc.yaml
in the current work directory api
server will start on default 1984 port (TCP)rtsp
server will start on default 8554 port (TCP)webrtc
will use port 8555 (TCP/UDP) for connectionsffmpeg
will use default transcoding options
Configuration options and a complete list of settings can be found in the wiki.
Available modules:
- streams
- api - HTTP API (important for WebRTC support)
- rtsp - RTSP Server (important for FFmpeg support)
- webrtc - WebRTC Server
- mp4 - MSE, MP4 stream and MP4 shapshot Server
- hls - HLS TS or fMP4 stream Server
- mjpeg - MJPEG Server
- ffmpeg - FFmpeg integration
- ngrok - ngrok integration (external access for private network)
- hass - Home Assistant integration
- log - logs config
Module: Streams
go2rtc support different stream source types. You can config one or multiple links of any type as stream source.
Available source types:
- rtsp -
RTSP
andRTSPS
cameras with two way audio support - rtmp -
RTMP
streams - http -
HTTP-FLV
,MPEG-TS
,JPEG
(snapshots),MJPEG
streams - onvif - get camera
RTSP
link and snapshot link usingONVIF
protocol - ffmpeg - FFmpeg integration (
HLS
,files
and many others) - ffmpeg:device - local USB Camera or Webcam
- exec - get media from external app output
- echo - get stream link from bash or python
- expr - get stream link via built-in expression language
- homekit - streaming from HomeKit Camera
- bubble - streaming from ESeeCloud/dvr163 NVR
- dvrip - streaming from DVR-IP NVR
- tapo - TP-Link Tapo cameras with two way audio support
- kasa - TP-Link Kasa cameras
- gopro - GoPro cameras
- ivideon - public cameras from Ivideon service
- hass - Home Assistant integration
- isapi - two way audio for Hikvision (ISAPI) cameras
- roborock - Roborock vacuums with cameras
- webrtc - WebRTC/WHEP sources
- webtorrent - WebTorrent source from another go2rtc
Read more about incoming sources
Two way audio
Supported for sources:
- RTSP cameras with ONVIF Profile T (back channel connection)
- DVRIP cameras
- TP-Link Tapo cameras
- Hikvision ISAPI cameras
- Roborock vacuums models with cameras
- Exec audio on server
- Any Browser as IP-camera
Two way audio can be used in browser with WebRTC technology. The browser will give access to the microphone only for HTTPS sites (read more).
go2rtc also support play audio files and live streams on this cameras.
Source: RTSP
streams:
sonoff_camera: rtsp://rtsp:12345678@192.168.1.123/av_stream/ch0
dahua_camera:
- rtsp://admin:password@192.168.1.123/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
- rtsp://admin:password@192.168.1.123/cam/realmonitor?channel=1&subtype=1
amcrest_doorbell:
- rtsp://username:password@192.168.1.123:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
unifi_camera: rtspx://192.168.1.123:7441/fD6ouM72bWoFijxK
glichy_camera: ffmpeg:rtsp://username:password@192.168.1.123/live/ch00_1
Recommendations
- Amcrest Doorbell users may want to disable two way audio, because with an active stream you won't have a call button working. You need to add
#backchannel=0
to the end of your RTSP link in YAML config file - Dahua Doorbell users may want to change backchannel audio codec
- Reolink users may want NOT to use RTSP protocol at all, some camera models have a very awful unusable stream implementation
- Ubiquiti UniFi users may want to disable HTTPS verification. Use
rtspx://
prefix instead ofrtsps://
. And don't use?enableSrtp
suffix - TP-Link Tapo users may skip login and password, because go2rtc support login without them
- If your camera has two RTSP links - you can add both of them as sources. This is useful when streams has different codecs, as example AAC audio with main stream and PCMU/PCMA audio with second stream
- If the stream from your camera is glitchy, try using ffmpeg source. It will not add CPU load if you won't use transcoding
- If the stream from your camera is very