From e960f90a97f8161d9d4ce73b12b8f3ec18b35bc3 Mon Sep 17 00:00:00 2001 From: Alex X Date: Mon, 5 Jan 2026 09:30:03 +0300 Subject: [PATCH 1/6] Add formats and protocols to readme --- README.md | 14 ++++++++++ pkg/README.md | 74 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5c402925..46fcaec8 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,20 @@ Ultimate camera streaming application with support for RTSP, WebRTC, HomeKit, FF - [two-way audio](#two-way-audio) for some cameras - can be [integrated to](#module-api) any smart home platform or be used as [standalone app](#go2rtc-binary) +**Supported Formats** - describes the communication API: authorization, encryption, command set, structure of media packets + +- devices: `alsa` (Linux audio), `v4l2` (Linux video) +- files: `adts`, `flv`, `h264`, `hevc`, `hls`, `mjpeg`, `mpegts`, `mp4`, `wav` +- network (public and well known): `mpjpeg`, `onvif`, `rtmp`, `rtp`, `rtsp`, `webrtc`, `y2m` (yuv4mpegpipe) +- network (private and exclusive): `bubble`, `doorbird`, `dvrip`, `eseecloud`, `gopro`, `hass` (Home Assistant), `homekit` (Apple), `isapi` (Hikvision), `kasa` (TP-Link), `nest` (Google), `ring`, `roborock`, `tapo` and `vigi` (TP-Link), `tuya`, `webtorrent`, `xiaomi` (Mi Home) +- webrtc related: `creality`, `kinesis` (Amazon), `openipc`, `switchbot`, `whep`, `whip`, `wyze` +- other: `ascii`, `echo`, `exec`, `expr`, `ffmpeg` + +**Supported Protocols** - describes the transport for data transmission + +- public: `http`, `pipe`, `rtmp`, `rtsp`, `tcp`, `udp`, `webrtc`, `ws` (WebSocket) +- private: `cs2` (PPPP), `hap` and `hds` (HomeKit), `tutk` (P2P) + **Inspired by:** - series of streaming projects from [@deepch](https://github.com/deepch) diff --git a/pkg/README.md b/pkg/README.md index e2759638..b027ed90 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -10,35 +10,51 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent - Codecs can be incoming - **Recevers codecs** - Codecs can be outgoing (two way audio) - **Senders codecs** -| Format | Source protocols | Ingress protocols | Recevers codecs | Senders codecs | Example | -|--------------|------------------|-------------------|------------------------------|--------------------|---------------| -| adts | http,tcp,pipe | http | aac | | `http:` | -| alsa | pipe | | | pcm | `alsa:` | -| bubble | http | | h264,hevc,pcm_alaw | | `bubble:` | -| dvrip | tcp | | h264,hevc,pcm_alaw,pcm_mulaw | pcm_alaw | `dvrip:` | -| flv | http,tcp,pipe | http | h264,aac | | `http:` | -| gopro | http+udp | | TODO | | `gopro:` | -| hass/webrtc | ws+udp,tcp | | TODO | | `hass:` | -| hls/mpegts | http | | h264,h265,aac,opus | | `http:` | -| homekit | homekit+udp | | h264,eld* | | `homekit:` | -| isapi | http | | | pcm_alaw,pcm_mulaw | `isapi:` | -| ivideon | ws | | h264 | | `ivideon:` | -| kasa | http | | h264,pcm_mulaw | | `kasa:` | -| h264 | http,tcp,pipe | http | h264 | | `http:` | -| hevc | http,tcp,pipe | http | hevc | | `http:` | -| mjpeg | http,tcp,pipe | http | mjpeg | | `http:` | -| mpjpeg | http,tcp,pipe | http | mjpeg | | `http:` | -| mpegts | http,tcp,pipe | http | h264,hevc,aac,opus | | `http:` | -| nest/webrtc | http+udp | | TODO | | `nest:` | -| roborock | mqtt+udp | | h264,opus | opus | `roborock:` | -| rtmp | rtmp | rtmp | h264,aac | | `rtmp:` | -| rtsp | rtsp+tcp,ws | rtsp+tcp | h264,hevc,aac,pcm*,opus | pcm*,opus | `rtsp:` | -| stdin | pipe | | | pcm_alaw,pcm_mulaw | `stdin:` | -| tapo | http | | h264,pcma | pcm_alaw | `tapo:` | -| wav | http,tcp,pipe | http | pcm_alaw,pcm_mulaw | | `http:` | -| webrtc* | TODO | TODO | h264,pcm_alaw,pcm_mulaw,opus | pcm_alaw,pcm_mulaw | `webrtc:` | -| webtorrent | TODO | TODO | TODO | TODO | `webtorrent:` | -| yuv4mpegpipe | http,tcp,pipe | http | rawvideo | | `http:` | +| Group | Format | Protocols | Ingress | Recevers codecs | Senders codecs | Example | +|------------|------------|---------------|---------|------------------------------|--------------------|---------------| +| Devices | alsa | pipe | | | pcm | `alsa:` | +| Devices | v4l2 | pipe | | | | | +| Files | adts | http,tcp,pipe | http | aac | | `http:` | +| Files | flv | http,tcp,pipe | http | h264,aac | | `http:` | +| Files | h264 | http,tcp,pipe | http | h264 | | `http:` | +| Files | hevc | http,tcp,pipe | http | hevc | | `http:` | +| Files | hls | http | | h264,h265,aac,opus | | `http:` | +| Files | mjpeg | http,tcp,pipe | http | mjpeg | | `http:` | +| Files | mpegts | http,tcp,pipe | http | h264,hevc,aac,opus | | `http:` | +| Files | mp4 | | | | | | +| Files | wav | http,tcp,pipe | http | pcm_alaw,pcm_mulaw | | `http:` | +| Net (pub) | mpjpeg | http,tcp,pipe | http | mjpeg | | `http:` | +| Net (pub) | onvif | rtsp | | | | | +| Net (pub) | rtmp | rtmp | rtmp | h264,aac | | `rtmp:` | +| Net (pub) | rtsp | rtsp,ws | rtsp | h264,hevc,aac,pcm*,opus | pcm*,opus | `rtsp:` | +| Net (pub) | webrtc* | webrtc | webrtc | h264,pcm_alaw,pcm_mulaw,opus | pcm_alaw,pcm_mulaw | `webrtc:` | +| Net (pub) | y4m | http,tcp,pipe | http | rawvideo | | `http:` | +| Net (priv) | bubble | http | | h264,hevc,pcm_alaw | | `bubble:` | +| Net (priv) | doorbird | http | | | | | +| Net (priv) | dvrip | tcp | | h264,hevc,pcm_alaw,pcm_mulaw | pcm_alaw | `dvrip:` | +| Net (priv) | eseecloud | http | | | | | +| Net (priv) | gopro | udp | | TODO | | `gopro:` | +| Net (priv) | hass | webrtc | | TODO | | `hass:` | +| Net (priv) | homekit | hap | | h264,eld* | | `homekit:` | +| Net (priv) | isapi | http | | | pcm_alaw,pcm_mulaw | `isapi:` | +| Net (priv) | kasa | http | | h264,pcm_mulaw | | `kasa:` | +| Net (priv) | nest | rtsp,webrtc | | TODO | | `nest:` | +| Net (priv) | ring | webrtc | | | | | +| Net (priv) | roborock | webrtc | | h264,opus | opus | `roborock:` | +| Net (priv) | tapo | http | | h264,pcma | pcm_alaw | `tapo:` | +| Net (priv) | tuya | webrtc | | | | | +| Net (priv) | vigi | http | | | | | +| Net (priv) | webtorrent | webrtc | TODO | TODO | TODO | `webtorrent:` | +| Net (priv) | xiaomi* | cs2,tutk | | | | | +| Services | flussonic | ws | | | | | +| Services | ivideon | ws | | h264 | | `ivideon:` | +| Services | yandex | webrtc | | | | | +| Other | ascii | http | | | | | +| Other | echo | * | | | | | +| Other | exec | pipe,rtsp | | | | | +| Other | expr | * | | | | | +| Other | ffmpeg | pipe,rtsp | | | | | +| Other | stdin | pipe | | | pcm_alaw,pcm_mulaw | `stdin:` | - **eld** - rare variant of aac codec - **pcm** - pcm_alaw pcm_mulaw pcm_s16be pcm_s16le From c4b32e3a0be49eb6a33182a575ab589e496a7d92 Mon Sep 17 00:00:00 2001 From: Johnnybyzhang Date: Sun, 11 Jan 2026 14:57:50 +0800 Subject: [PATCH 2/6] xiaomi/cs2: fix TCP keepalive to match official Mi Home app Based on PCAP analysis of official Mi Home app traffic, the keepalive mechanism was incorrect: Before (broken): - Sent PING every 5s only when receiving data - Responded to PING with PONG After (fixed): - Send PING every 1 second independently via dedicated goroutine - Don't respond to PING with PONG (official app doesn't either) - Both sides send PING bidirectionally as heartbeats The official app sends 199 PING messages and 0 PONG messages in a typical session. This fix matches that behavior. Fixes connection resets after prolonged streaming sessions with Xiaomi cameras using the CS2 P2P protocol. --- pkg/xiaomi/cs2/conn.go | 47 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/pkg/xiaomi/cs2/conn.go b/pkg/xiaomi/cs2/conn.go index 198b3beb..a99f0af5 100644 --- a/pkg/xiaomi/cs2/conn.go +++ b/pkg/xiaomi/cs2/conn.go @@ -24,8 +24,16 @@ func Dial(host, transport string) (*Conn, error) { isTCP: isTCP, rawCh0: make(chan []byte, 10), rawCh2: make(chan []byte, 100), + done: make(chan struct{}), } go c.worker() + + // For TCP connections, start independent keepalive goroutine + // Official Mi Home app sends PING every 1 second bidirectionally + if isTCP { + go c.keepalive() + } + return c, nil } @@ -38,6 +46,7 @@ type Conn struct { seqCh3 uint16 rawCh0 chan []byte rawCh2 chan []byte + done chan struct{} // signals connection close to keepalive goroutine cmdMu sync.Mutex cmdAck func() @@ -54,6 +63,7 @@ const ( msgDrwAck = 0xD1 msgPing = 0xE0 msgPong = 0xE1 + msgAlive = 0xF0 // Camera heartbeat/alive signal msgClose = 0xF1 ) @@ -102,17 +112,38 @@ func handshake(host, transport string) (net.Conn, error) { return conn, nil } +// keepalive sends PING every 1 second for TCP connections. +// Based on PCAP analysis of official Mi Home app: both sides send PING bidirectionally, +// neither responds with PONG. This keeps the connection alive. +func (c *Conn) keepalive() { + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + + ping := []byte{magic, msgPing, 0, 0} + + for { + select { + case <-c.done: + return + case <-ticker.C: + if _, err := c.conn.Write(ping); err != nil { + return + } + } + } +} + func (c *Conn) worker() { defer func() { close(c.rawCh0) close(c.rawCh2) + close(c.done) // signal keepalive goroutine to stop }() chAck := make([]uint16, 4) // only for UDP buf := make([]byte, 1200) var ch2WaitSize int var ch2WaitData []byte - var keepaliveTS time.Time for { n, err := c.conn.Read(buf) @@ -125,13 +156,7 @@ func (c *Conn) worker() { case msgDrw: ch := buf[5] - if c.isTCP { - // For TCP we should using ping/pong. - if now := time.Now(); now.After(keepaliveTS) { - _, _ = c.conn.Write([]byte{magic, msgPing, 0, 0}) - keepaliveTS = now.Add(5 * time.Second) - } - } else { + if !c.isTCP { // For UDP we should using ack. seqHI := buf[6] seqLO := buf[7] @@ -179,7 +204,11 @@ func (c *Conn) worker() { } case msgPing: - _, _ = c.conn.Write([]byte{magic, msgPong, 0, 0}) + // Official Mi Home app: both sides send PING, neither responds with PONG + // Just acknowledge receipt, don't send PONG + continue + case msgAlive: + // Some cameras may send 0xF0 as heartbeat - just ignore like PING continue case msgPong, msgP2PRdyUDP, msgP2PRdyTCP, msgClose: continue // skip it From ff04a0d4b2c3ef4dafc794ee0dfb3121c135aaaa Mon Sep 17 00:00:00 2001 From: Johnnybyzhang Date: Sun, 11 Jan 2026 15:05:03 +0800 Subject: [PATCH 3/6] xiaomi/cs2: reduce TCP keepalive interval to 1 second Based on PCAP analysis of official Mi Home app traffic: - Official app sends PING every ~1 second - Previous 5-second interval was too slow, causing connection resets Simply reduce keepalive timeout from 5s to 1s. --- pkg/xiaomi/cs2/conn.go | 48 +++++++++--------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/pkg/xiaomi/cs2/conn.go b/pkg/xiaomi/cs2/conn.go index a99f0af5..cde09ab5 100644 --- a/pkg/xiaomi/cs2/conn.go +++ b/pkg/xiaomi/cs2/conn.go @@ -24,16 +24,8 @@ func Dial(host, transport string) (*Conn, error) { isTCP: isTCP, rawCh0: make(chan []byte, 10), rawCh2: make(chan []byte, 100), - done: make(chan struct{}), } go c.worker() - - // For TCP connections, start independent keepalive goroutine - // Official Mi Home app sends PING every 1 second bidirectionally - if isTCP { - go c.keepalive() - } - return c, nil } @@ -46,7 +38,6 @@ type Conn struct { seqCh3 uint16 rawCh0 chan []byte rawCh2 chan []byte - done chan struct{} // signals connection close to keepalive goroutine cmdMu sync.Mutex cmdAck func() @@ -63,7 +54,6 @@ const ( msgDrwAck = 0xD1 msgPing = 0xE0 msgPong = 0xE1 - msgAlive = 0xF0 // Camera heartbeat/alive signal msgClose = 0xF1 ) @@ -112,38 +102,17 @@ func handshake(host, transport string) (net.Conn, error) { return conn, nil } -// keepalive sends PING every 1 second for TCP connections. -// Based on PCAP analysis of official Mi Home app: both sides send PING bidirectionally, -// neither responds with PONG. This keeps the connection alive. -func (c *Conn) keepalive() { - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - - ping := []byte{magic, msgPing, 0, 0} - - for { - select { - case <-c.done: - return - case <-ticker.C: - if _, err := c.conn.Write(ping); err != nil { - return - } - } - } -} - func (c *Conn) worker() { defer func() { close(c.rawCh0) close(c.rawCh2) - close(c.done) // signal keepalive goroutine to stop }() chAck := make([]uint16, 4) // only for UDP buf := make([]byte, 1200) var ch2WaitSize int var ch2WaitData []byte + var keepaliveTS time.Time for { n, err := c.conn.Read(buf) @@ -156,7 +125,14 @@ func (c *Conn) worker() { case msgDrw: ch := buf[5] - if !c.isTCP { + if c.isTCP { + // For TCP we should send ping every second to keep connection alive. + // Based on PCAP analysis: official Mi Home app sends PING every ~1s. + if now := time.Now(); now.After(keepaliveTS) { + _, _ = c.conn.Write([]byte{magic, msgPing, 0, 0}) + keepaliveTS = now.Add(time.Second) + } + } else { // For UDP we should using ack. seqHI := buf[6] seqLO := buf[7] @@ -204,11 +180,7 @@ func (c *Conn) worker() { } case msgPing: - // Official Mi Home app: both sides send PING, neither responds with PONG - // Just acknowledge receipt, don't send PONG - continue - case msgAlive: - // Some cameras may send 0xF0 as heartbeat - just ignore like PING + _, _ = c.conn.Write([]byte{magic, msgPong, 0, 0}) continue case msgPong, msgP2PRdyUDP, msgP2PRdyTCP, msgClose: continue // skip it From eb39b80883b7c2c3c4ff2ab7957d4560bfae7220 Mon Sep 17 00:00:00 2001 From: Alex X Date: Sun, 11 Jan 2026 16:46:23 +0300 Subject: [PATCH 4/6] Fix login to Xiaomi account with captcha #1985 --- pkg/xiaomi/cloud.go | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkg/xiaomi/cloud.go b/pkg/xiaomi/cloud.go index 5e1e73cc..0dcfd241 100644 --- a/pkg/xiaomi/cloud.go +++ b/pkg/xiaomi/cloud.go @@ -78,12 +78,9 @@ func (c *Cloud) Login(username, password string) error { } req := Request{ - Method: "POST", - URL: "https://account.xiaomi.com/pass/serviceLoginAuth2", - RawBody: form.Encode(), - Headers: url.Values{ - "Content-Type": {"application/x-www-form-urlencoded"}, - }, + Method: "POST", + URL: "https://account.xiaomi.com/pass/serviceLoginAuth2", + Body: form, RawCookies: cookies, }.Encode() @@ -105,7 +102,7 @@ func (c *Cloud) Login(username, password string) error { return err } - // save auth for two step verification + // save auth for two-step verification c.auth = map[string]string{ "username": username, "password": password, @@ -265,11 +262,17 @@ func (c *Cloud) sendTicket() error { cookies += "; ick=" + c.auth["ick"] } + form := url.Values{ + "_json": {"true"}, + "icode": {captCode}, + "retry": {"0"}, + } + req = Request{ Method: "POST", URL: "https://account.xiaomi.com/identity/auth/send" + name + "Ticket", + Body: form, RawCookies: cookies, - RawBody: `{"retry":0,"icode":"` + captCode + `","_json":"true"}`, }.Encode() res, err = c.client.Do(req) @@ -531,7 +534,7 @@ type Request struct { Method string URL string RawParams string - RawBody string + Body url.Values Headers url.Values RawCookies string } @@ -542,8 +545,8 @@ func (r Request) Encode() *http.Request { } var body io.Reader - if r.RawBody != "" { - body = strings.NewReader(r.RawBody) + if r.Body != nil { + body = strings.NewReader(r.Body.Encode()) } req, err := http.NewRequest(r.Method, r.URL, body) @@ -554,7 +557,9 @@ func (r Request) Encode() *http.Request { if r.Headers != nil { req.Header = http.Header(r.Headers) } - + if r.Body != nil { + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + } if r.RawCookies != "" { req.Header.Set("Cookie", r.RawCookies) } From f9f22cdd0b8c10fd0ff61db4a34f0345dc480d11 Mon Sep 17 00:00:00 2001 From: Alex X Date: Sun, 11 Jan 2026 19:56:45 +0300 Subject: [PATCH 5/6] Add about OS versions to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 46fcaec8..03db381f 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,8 @@ Download binary for your OS from [latest release](https://github.com/AlexxIT/go2 Don't forget to fix the rights `chmod +x go2rtc_xxx_xxx` on Linux and Mac. +PS. The application is compiled with the latest versions of the Go language for maximum speed and security. Therefore, the [minimum OS versions](https://go.dev/wiki/MinimumRequirements) depend on the Go language. + ### go2rtc: Docker The Docker container [`alexxit/go2rtc`](https://hub.docker.com/r/alexxit/go2rtc) supports multiple architectures including `amd64`, `386`, `arm64`, and `arm`. This container offers the same functionality as the [Home Assistant Add-on](#go2rtc-home-assistant-add-on) but is designed to operate independently of Home Assistant. It comes preinstalled with [FFmpeg](#source-ffmpeg) and [Python](#source-echo). From e614513b9752b9565d1998e9b24f38e8f5fba700 Mon Sep 17 00:00:00 2001 From: Alex X Date: Sun, 11 Jan 2026 19:57:52 +0300 Subject: [PATCH 6/6] Fix formats table in readme --- pkg/README.md | 122 +++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 62 deletions(-) diff --git a/pkg/README.md b/pkg/README.md index b027ed90..479dcce3 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -10,51 +10,49 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent - Codecs can be incoming - **Recevers codecs** - Codecs can be outgoing (two way audio) - **Senders codecs** -| Group | Format | Protocols | Ingress | Recevers codecs | Senders codecs | Example | -|------------|------------|---------------|---------|------------------------------|--------------------|---------------| -| Devices | alsa | pipe | | | pcm | `alsa:` | -| Devices | v4l2 | pipe | | | | | -| Files | adts | http,tcp,pipe | http | aac | | `http:` | -| Files | flv | http,tcp,pipe | http | h264,aac | | `http:` | -| Files | h264 | http,tcp,pipe | http | h264 | | `http:` | -| Files | hevc | http,tcp,pipe | http | hevc | | `http:` | -| Files | hls | http | | h264,h265,aac,opus | | `http:` | -| Files | mjpeg | http,tcp,pipe | http | mjpeg | | `http:` | -| Files | mpegts | http,tcp,pipe | http | h264,hevc,aac,opus | | `http:` | -| Files | mp4 | | | | | | -| Files | wav | http,tcp,pipe | http | pcm_alaw,pcm_mulaw | | `http:` | -| Net (pub) | mpjpeg | http,tcp,pipe | http | mjpeg | | `http:` | -| Net (pub) | onvif | rtsp | | | | | -| Net (pub) | rtmp | rtmp | rtmp | h264,aac | | `rtmp:` | -| Net (pub) | rtsp | rtsp,ws | rtsp | h264,hevc,aac,pcm*,opus | pcm*,opus | `rtsp:` | -| Net (pub) | webrtc* | webrtc | webrtc | h264,pcm_alaw,pcm_mulaw,opus | pcm_alaw,pcm_mulaw | `webrtc:` | -| Net (pub) | y4m | http,tcp,pipe | http | rawvideo | | `http:` | -| Net (priv) | bubble | http | | h264,hevc,pcm_alaw | | `bubble:` | -| Net (priv) | doorbird | http | | | | | -| Net (priv) | dvrip | tcp | | h264,hevc,pcm_alaw,pcm_mulaw | pcm_alaw | `dvrip:` | -| Net (priv) | eseecloud | http | | | | | -| Net (priv) | gopro | udp | | TODO | | `gopro:` | -| Net (priv) | hass | webrtc | | TODO | | `hass:` | -| Net (priv) | homekit | hap | | h264,eld* | | `homekit:` | -| Net (priv) | isapi | http | | | pcm_alaw,pcm_mulaw | `isapi:` | -| Net (priv) | kasa | http | | h264,pcm_mulaw | | `kasa:` | -| Net (priv) | nest | rtsp,webrtc | | TODO | | `nest:` | -| Net (priv) | ring | webrtc | | | | | -| Net (priv) | roborock | webrtc | | h264,opus | opus | `roborock:` | -| Net (priv) | tapo | http | | h264,pcma | pcm_alaw | `tapo:` | -| Net (priv) | tuya | webrtc | | | | | -| Net (priv) | vigi | http | | | | | -| Net (priv) | webtorrent | webrtc | TODO | TODO | TODO | `webtorrent:` | -| Net (priv) | xiaomi* | cs2,tutk | | | | | -| Services | flussonic | ws | | | | | -| Services | ivideon | ws | | h264 | | `ivideon:` | -| Services | yandex | webrtc | | | | | -| Other | ascii | http | | | | | -| Other | echo | * | | | | | -| Other | exec | pipe,rtsp | | | | | -| Other | expr | * | | | | | -| Other | ffmpeg | pipe,rtsp | | | | | -| Other | stdin | pipe | | | pcm_alaw,pcm_mulaw | `stdin:` | +| Group | Format | Protocols | Ingress | Recevers codecs | Senders codecs | Example | +|------------|--------------|-----------------|---------|---------------------------------|---------------------|---------------| +| Devices | alsa | pipe | | | pcm | `alsa:` | +| Devices | v4l2 | pipe | | | | `v4l2:` | +| Files | adts | http, tcp, pipe | http | aac | | `http:` | +| Files | flv | http, tcp, pipe | http | h264, aac | | `http:` | +| Files | h264 | http, tcp, pipe | http | h264 | | `http:` | +| Files | hevc | http, tcp, pipe | http | hevc | | `http:` | +| Files | hls | http | | h264, h265, aac, opus | | `http:` | +| Files | mjpeg | http, tcp, pipe | http | mjpeg | | `http:` | +| Files | mpegts | http, tcp, pipe | http | h264, hevc, aac, opus | | `http:` | +| Files | wav | http, tcp, pipe | http | pcm_alaw, pcm_mulaw | | `http:` | +| Net (pub) | mpjpeg | http, tcp, pipe | http | mjpeg | | `http:` | +| Net (pub) | onvif | rtsp | | | | `onvif:` | +| Net (pub) | rtmp | rtmp | rtmp | h264, aac | | `rtmp:` | +| Net (pub) | rtsp | rtsp, ws | rtsp | h264, hevc, aac, pcm*, opus | pcm*, opus | `rtsp:` | +| Net (pub) | webrtc* | webrtc | webrtc | h264, pcm_alaw, pcm_mulaw, opus | pcm_alaw, pcm_mulaw | `webrtc:` | +| Net (pub) | yuv4mpegpipe | http, tcp, pipe | http | rawvideo | | `http:` | +| Net (priv) | bubble | http | | h264, hevc, pcm_alaw | | `bubble:` | +| Net (priv) | doorbird | http | | | | `doorbird:` | +| Net (priv) | dvrip | tcp | | h264, hevc, pcm_alaw, pcm_mulaw | pcm_alaw | `dvrip:` | +| Net (priv) | eseecloud | http | | | | `eseecloud:` | +| Net (priv) | gopro | udp | | TODO | | `gopro:` | +| Net (priv) | hass | webrtc | | TODO | | `hass:` | +| Net (priv) | homekit | hap | | h264, eld* | | `homekit:` | +| Net (priv) | isapi | http | | | pcm_alaw, pcm_mulaw | `isapi:` | +| Net (priv) | kasa | http | | h264, pcm_mulaw | | `kasa:` | +| Net (priv) | nest | rtsp, webrtc | | TODO | | `nest:` | +| Net (priv) | ring | webrtc | | | | `ring:` | +| Net (priv) | roborock | webrtc | | h264, opus | opus | `roborock:` | +| Net (priv) | tapo | http | | h264, pcma | pcm_alaw | `tapo:` | +| Net (priv) | tuya | webrtc | | | | `tuya:` | +| Net (priv) | vigi | http | | | | `vigi:` | +| Net (priv) | webtorrent | webrtc | TODO | TODO | TODO | `webtorrent:` | +| Net (priv) | xiaomi* | cs2, tutk | | | | `xiaomi:` | +| Services | flussonic | ws | | | | `flussonic:` | +| Services | ivideon | ws | | h264 | | `ivideon:` | +| Services | yandex | webrtc | | | | `yandex:` | +| Other | echo | * | | | | `echo:` | +| Other | exec | pipe, rtsp | | | | `exec:` | +| Other | expr | * | | | | `expr:` | +| Other | ffmpeg | pipe, rtsp | | | | `ffmpeg:` | +| Other | stdin | pipe | | | pcm_alaw, pcm_mulaw | `stdin:` | - **eld** - rare variant of aac codec - **pcm** - pcm_alaw pcm_mulaw pcm_s16be pcm_s16le @@ -62,23 +60,23 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent ## Consumers (output) -| Format | Protocol | Send codecs | Recv codecs | Example | -|--------------|-------------|------------------------------|-------------------------|---------------------------------------| -| adts | http | aac | | `GET /api/stream.adts` | -| ascii | http | mjpeg | | `GET /api/stream.ascii` | -| flv | http | h264,aac | | `GET /api/stream.flv` | -| hls/mpegts | http | h264,hevc,aac | | `GET /api/stream.m3u8` | -| hls/fmp4 | http | h264,hevc,aac,pcm*,opus | | `GET /api/stream.m3u8?mp4` | -| homekit | homekit+udp | h264,opus | | Apple HomeKit app | -| mjpeg | ws | mjpeg | | `{"type":"mjpeg"}` -> `/api/ws` | -| mpjpeg | http | mjpeg | | `GET /api/stream.mjpeg` | -| mp4 | http | h264,hevc,aac,pcm*,opus | | `GET /api/stream.mp4` | -| mse/fmp4 | ws | h264,hevc,aac,pcm*,opus | | `{"type":"mse"}` -> `/api/ws` | -| mpegts | http | h264,hevc,aac | | `GET /api/stream.ts` | -| rtmp | rtmp | h264,aac | | `rtmp://localhost:1935/{stream_name}` | -| rtsp | rtsp+tcp | h264,hevc,aac,pcm*,opus | | `rtsp://localhost:8554/{stream_name}` | -| webrtc | TODO | h264,pcm_alaw,pcm_mulaw,opus | pcm_alaw,pcm_mulaw,opus | `{"type":"webrtc"}` -> `/api/ws` | -| yuv4mpegpipe | http | rawvideo | | `GET /api/stream.y4m` | +| Format | Protocol | Send codecs | Recv codecs | Example | +|--------------|----------|---------------------------------|---------------------------|---------------------------------------| +| adts | http | aac | | `GET /api/stream.adts` | +| ascii | http | mjpeg | | `GET /api/stream.ascii` | +| flv | http | h264, aac | | `GET /api/stream.flv` | +| hls/mpegts | http | h264, hevc, aac | | `GET /api/stream.m3u8` | +| hls/fmp4 | http | h264, hevc, aac, pcm*, opus | | `GET /api/stream.m3u8?mp4` | +| homekit | hap | h264, opus | | Apple HomeKit app | +| mjpeg | ws | mjpeg | | `{"type":"mjpeg"}` -> `/api/ws` | +| mpjpeg | http | mjpeg | | `GET /api/stream.mjpeg` | +| mp4 | http | h264, hevc, aac, pcm*, opus | | `GET /api/stream.mp4` | +| mse/fmp4 | ws | h264, hevc, aac, pcm*, opus | | `{"type":"mse"}` -> `/api/ws` | +| mpegts | http | h264, hevc, aac | | `GET /api/stream.ts` | +| rtmp | rtmp | h264, aac | | `rtmp://localhost:1935/{stream_name}` | +| rtsp | rtsp | h264, hevc, aac, pcm*, opus | | `rtsp://localhost:8554/{stream_name}` | +| webrtc | webrtc | h264, pcm_alaw, pcm_mulaw, opus | pcm_alaw, pcm_mulaw, opus | `{"type":"webrtc"}` -> `/api/ws` | +| yuv4mpegpipe | http | rawvideo | | `GET /api/stream.y4m` | - **pcm** - pcm_alaw pcm_mulaw pcm_s16be pcm_s16le