diff --git a/README.md b/README.md index e3612578..0bb2ea52 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ A summary table of all modules and features can be found [here](internal/README. - [`hass`](internal/hass/README.md) - Import cameras from [Home Assistant](https://www.home-assistant.io/) config files. - [`homekit`](internal/homekit/README.md) - Cameras with [Apple HomeKit](https://www.apple.com/home-app/accessories/) protocol. - [`isapi`](internal/isapi/README.md) - Two-way audio for [Hikvision ISAPI](https://tpp.hikvision.com/download/ISAPI_OTAP) protocol. -- [`kasa`](internal/tapo/README.md#tp-link-kasa) - [TP-Link Kasa](https://www.kasasmart.com/) cameras. +- [`kasa`](internal/kasa/README.md) - [TP-Link Kasa](https://www.kasasmart.com/) cameras. - [`multitrans`](internal/multitrans/README.md) - Two-way audio for Chinese version of [TP-Link](https://www.tp-link.com.cn/) cameras. - [`nest`](internal/nest/README.md) - [Google Nest](https://developers.google.com/nest/device-access/supported-devices) cameras through user-unfriendly and paid APIs. - [`ring`](internal/ring/README.md) - Ring cameras with two-way audio support. diff --git a/internal/README.md b/internal/README.md index 08b078dd..4a5e8354 100644 --- a/internal/README.md +++ b/internal/README.md @@ -41,6 +41,7 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent | [`http`] | `yuv4mpegpipe` | `http`, `tcp` | yes | | | | | [`isapi`] | `alaw`, `mulaw` | `http` | | | | yes | | [`ivideon`] | `mp4` | `ws` | yes | | | | +| [`kasa`] | `h264`, `mulaw` | `http` | yes | | | | | [`mjpeg`] | `ascii` | `http` | | yes | | | | [`mjpeg`] | `jpeg` | `http` | | yes | | | | [`mjpeg`] | `mpjpeg` | `http` | | yes | yes | | @@ -86,6 +87,7 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent [`http`]: http/README.md [`isapi`]: isapi/README.md [`ivideon`]: ivideon/README.md +[`kasa`]: kasa/README.md [`mjpeg`]: mjpeg/README.md [`mp4`]: mp4/README.md [`mpegts`]: mpegts/README.md diff --git a/internal/kasa/README.md b/internal/kasa/README.md new file mode 100644 index 00000000..0ce115e7 --- /dev/null +++ b/internal/kasa/README.md @@ -0,0 +1,15 @@ +# TP-Link Kasa + +[`new in v1.7.0`](https://github.com/AlexxIT/go2rtc/releases/tag/v1.7.0) + +[TP-Link Kasa](https://www.kasasmart.com/) non-standard protocol [more info](https://medium.com/@hu3vjeen/reverse-engineering-tp-link-kc100-bac4641bf1cd). + +- `username` - urlsafe email, `alex@gmail.com` -> `alex%40gmail.com` +- `password` - base64password, `secret1` -> `c2VjcmV0MQ==` + +```yaml +streams: + kc401: kasa://username:password@192.168.1.123:19443/https/stream/mixed +``` + +Tested: KD110, KC200, KC401, KC420WS, EC71. diff --git a/internal/kasa/kasa.go b/internal/kasa/kasa.go new file mode 100644 index 00000000..11f5c988 --- /dev/null +++ b/internal/kasa/kasa.go @@ -0,0 +1,13 @@ +package kasa + +import ( + "github.com/AlexxIT/go2rtc/internal/streams" + "github.com/AlexxIT/go2rtc/pkg/core" + "github.com/AlexxIT/go2rtc/pkg/kasa" +) + +func Init() { + streams.HandleFunc("kasa", func(source string) (core.Producer, error) { + return kasa.Dial(source) + }) +} diff --git a/main.go b/main.go index ca70e84d..c05791da 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( "github.com/AlexxIT/go2rtc/internal/http" "github.com/AlexxIT/go2rtc/internal/isapi" "github.com/AlexxIT/go2rtc/internal/ivideon" + "github.com/AlexxIT/go2rtc/internal/kasa" "github.com/AlexxIT/go2rtc/internal/mjpeg" "github.com/AlexxIT/go2rtc/internal/mp4" "github.com/AlexxIT/go2rtc/internal/mpegts" @@ -96,6 +97,7 @@ func main() { {"gopro", gopro.Init}, {"isapi", isapi.Init}, {"ivideon", ivideon.Init}, + {"kasa", kasa.Init}, {"mpegts", mpegts.Init}, {"multitrans", multitrans.Init}, {"nest", nest.Init}, diff --git a/pkg/README.md b/pkg/README.md index 479dcce3..46a0c9d9 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -89,12 +89,21 @@ Some formats and protocols go2rtc supports exclusively. They have no equivalent ## Developers -File naming: +**File naming:** - `pkg/{format}/producer.go` - producer for this format (also if support backchannel) - `pkg/{format}/consumer.go` - consumer for this format - `pkg/{format}/backchanel.go` - producer with only backchannel func +**Mentioning modules:** + +- [`main.go`](../main.go) +- [`README.md`](../README.md) +- [`internal/README.md`](../internal/README.md) +- [`website/.vitepress/config.js`](../website/.vitepress/config.js) +- [`website/api/openapi.yaml`](../website/api/openapi.yaml) +- [`www/schema.json`](../www/schema.json) + ## Useful links - https://www.wowza.com/blog/streaming-protocols diff --git a/website/.vitepress/config.js b/website/.vitepress/config.js index d7b60c28..c5ef0776 100644 --- a/website/.vitepress/config.js +++ b/website/.vitepress/config.js @@ -130,9 +130,10 @@ export default defineConfig({ {text: 'eseecloud', link: '/internal/eseecloud/'}, {text: 'flussonic', link: '/internal/flussonic/'}, {text: 'gopro', link: '/internal/gopro/'}, + {text: 'hass', link: '/internal/hass/'}, {text: 'isapi', link: '/internal/isapi/'}, {text: 'ivideon', link: '/internal/ivideon/'}, - {text: 'hass', link: '/internal/hass/'}, + {text: 'kasa', link: '/internal/kasa/'}, {text: 'mpegts', link: '/internal/mpegts/'}, {text: 'multitrans', link: '/internal/multitrans/'}, {text: 'nest', link: '/internal/nest/'}, diff --git a/www/schema.json b/www/schema.json index d9c87e40..29c2ca1e 100644 --- a/www/schema.json +++ b/www/schema.json @@ -171,6 +171,7 @@ "gopro", "isapi", "ivideon", + "kasa", "mpegts", "nest", "ring",