MiroTalk LK live streaming
The host (or a co-host) streams the whole meeting to YouTube, Twitch, Facebook or any RTMP / RTMPS server with the Go live button (in the ⋯ menu on small screens). It runs on the same LiveKit Egress as server recording: egress joins the room, lays it out like a recording and sends it to the platform instead of writing a file. The host's device does no extra work, and leaving the meeting doesn't stop the stream.
Everyone in the meeting, including people who join later, sees a pulsing ● LIVE badge and a notification while the meeting is streamed, so let participants know where consent is required. A live stream and a recording can run at the same time; each has its own badge.
An end-to-end encrypted meeting can't be streamed: egress can't decrypt it.
Going live
- In the platform, get the stream key: YouTube Studio → Create → Go live → Stream; Twitch Creator Dashboard → Settings → Stream; Facebook Live Producer → Streaming software.
- In the meeting, press Go live, pick the platform and paste the stream key. The stream URL is filled in for YouTube, Twitch and Facebook (it can be changed, e.g. to a backup server); for Other (RTMP server) enter the server's
rtmp://orrtmps://URL, with the key in its own field or at the end of the URL. - The badge turns on once egress is streaming (a few seconds). End live stream stops it; the meeting goes on.
The stream key goes to the server once, to start the stream: it isn't logged, kept in the room or shown to anyone, and the browser remembers only the platform (and a custom server's URL without the key). If the platform refuses the stream (a wrong or expired key, a stream that isn't set up) or drops it later, the LIVE badge goes away and the hosts are told why.
Setup
Live streaming needs the egress service, like server recording:
# .env
STREAMING_ENABLED=true
# STREAMING_LAYOUT=speaker # default: RECORDING_LAYOUT, or grid
# STREAMING_QUALITY=720p # 720p or 1080p
# STREAMING_ALLOWED_HOSTS=a.rtmp.youtube.com,live.twitch.tv,*.contribute.live-video.net,live-api-s.facebook.com
docker compose --profile recording up -d --build # starts egress; RECORDING_ENABLED can stay false
For local development, use npm run recording:dev (see Recording) and set STREAMING_ENABLED=true.
Testing from a local machine
Egress pushes the stream out to the platform, so a local machine can go live without a public IP or domain:
LIVEKIT_NODE_IP=$(ipconfig getifaddr en0) npm run recording:dev # macOS; on Linux use your LAN IP
# .env: STREAMING_ENABLED=true
npm run dev
Then start a meeting, turn on a camera or microphone, press Go live and paste a stream key. To test without broadcasting to viewers, use Twitch's bandwidth test: add ?bandwidthtest=true to the stream key (e.g. live_123456_abc?bandwidthtest=true). Twitch then accepts the stream and reports its health in Stream Manager or Twitch Inspector without putting the channel live. If the LIVE badge doesn't appear, the egress logs show why (docker compose -f docker-compose.dev.yml logs -f egress), for example an RTMP error for a wrong key.
- CPU: a live stream costs about as much as a recording (~1-2 vCPUs at 720p, about twice that at 1080p), and a stream and a recording of the same meeting are two egress jobs. The egress container is capped at
EGRESS_CPUS(default2); raise it, or run egress on its own machine, to stream and record at once. - Bandwidth: about 3 Mbit/s upload per stream at 720p, 5 Mbit/s at 1080p.
- The LIVE badge relies on LiveKit's webhooks (
egress_ended), which the bundled setups already send to the app (see Webhooks): that's how a stream that stops on its own is noticed. Without them, a host can still clear the badge with End live stream.
Where streams may go
Egress connects to whatever URL a host enters, and anyone who starts a meeting is a host unless host sign-in is on. So by default the server refuses stream URLs that point to this server, to private networks or to special-purpose addresses (localhost, 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, benchmarking, documentation, multicast and reserved ranges, link-local and unique local IPv6 addresses, and IPv6 addresses that embed an IPv4 one: NAT64, 6to4, Teredo), checking the host name's DNS records too, and allows every public host.
That check has a limit: egress looks the host name up again when it connects, so a DNS server that answers differently the second time could still point it at your network. In production, set STREAMING_ALLOWED_HOSTS to the platforms you use; the app logs a warning at startup when streaming is on without it.
STREAMING_ALLOWED_HOSTS turns that into an allow-list: only these hosts (comma-separated host names, *.domain for a whole domain, or IP addresses), and no others, whether public or private. Use it to limit streaming to the platforms you use, or to allow your own RTMP server on a private network (e.g. STREAMING_ALLOWED_HOSTS=rtmp.internal.example).
Webhooks and metrics
- A
stream.finishedwebhook is sent when a live stream ends, with its status and error (never its URL). - With metrics on,
mirotalk_live_streamscounts the meetings being streamed, andmirotalk_egress_jobsincludes live streams (see monitoring).