Why We Use LiveKit for Live Streaming
Technical architecture decision | Last updated: November 2, 2026
1. Overview
We use LiveKit because our streaming product is fundamentally a web application.
Our stream layout, overlays, recitation text, and other visual elements are built as React components. We need a streaming infrastructure that can broadcast this exact web page to YouTube while providing multi-camera support, rooms, and real-time remote control.
LiveKit is the best fit for our architecture because it brings all these capabilities together in one open-source stack.
Other alternatives either:
-
Require us to rebuild our existing HTML/CSS overlays.
-
Break the consistency between Studio preview and the actual broadcast.
-
Require significant changes to our existing Studio architecture.
-
Introduce additional infrastructure without providing meaningful cost savings.
With LiveKit, we can keep our existing Studio implementation while choosing between self-hosted infrastructure and LiveKit Cloud.
2. What We Currently Use LiveKit For
The following table documents the features currently implemented in our product and where they are integrated into the codebase.
| Feature | How LiveKit Provides It | Implementation |
|---|---|---|
| Web page broadcasting | RoomComposite Egress opens our custom layout page in headless Chrome using custom_base_url and encodes it into a video stream. |
livekit_client.start_stream_egress, LiveLayoutPage.tsx |
| Identical preview and broadcast | Both Studio preview and the egress page render the same LiveLayout component. |
LiveLayout.tsx |
| Rich HTML/CSS overlays | Supports text, images, QR codes, lower thirds, recitation text, tickers, and custom fonts. | LiveLayout.tsx, OverlaysPanel.tsx, overlayStyle |
| Tibetan and Chinese text | Chromium handles complex script rendering, including Tibetan stacked characters. | Layout page |
| Real-time scene and overlay updates | Backend updates room metadata, and the layout reacts to RoomMetadataChanged events. |
update_room_metadata, LiveLayoutPage.tsx |
| Live recitation line | Studio publishes the current line through a reliable data channel topic. | useLiveRoom.ts, LIVE_LINE_TOPIC |
| Multiple cameras | Each camera joins as a participant and publishes its own video track. | CamerasPanel.tsx, CameraSwitcher.tsx |
| Phone as a camera | A phone joins the room through a camera-only token. | PhoneCameraPage.tsx, camera_token |
| Screen sharing | Native screen-sharing and screen-sharing audio support. | publisher_token |
| Remote overlay controller | A separate controller link can update broadcast data without viewing or publishing video. | controller_token, live-control/ |
| Role-based access | Signed JWT tokens provide separate permissions for publishers, cameras, controllers, and administrators. | livekit_client.py |
| Multiple YouTube destinations | One egress encodes the stream once and sends it to multiple RTMP destinations. | start_stream_egress(rtmp_urls=[...]) |
| Dynamic RTMP destinations | Destinations can be added or removed during an active stream using UpdateStream. |
update_stream_urls |
| Quality presets | Supports predefined H.264 encoding configurations, including 1080p30 and 720p30. | _EGRESS_PRESETS |
| Failure notifications | Signed webhooks notify the backend when an egress fails. | verify_webhook, live_studio_service.py |
| Room lifecycle management | Rooms can be created, deleted, automatically closed, and have participants removed. | create_room, delete_room, remove_participant |
| Network resilience | Built-in reconnection, connection-quality monitoring, and TURN support. | useLiveRoom.ts |
3. Alternatives We Evaluated
We evaluated several approaches based on their ability to preserve our existing Studio, support custom overlays, scale to multiple simultaneous broadcasts, and control infrastructure costs.
Comparison
| Solution | Existing Overlays | Migration Effort | Estimated Cost | Decision |
|---|---|---|---|---|
| LiveKit (Self-hosted) | Fully supported | None | ~$0.60/stream-hour + ~$800/month fixed infrastructure | Selected for scale |
| LiveKit Cloud | Fully supported | Minimal; change URL and credentials | ~$0.90–$1.20/stream-hour, starting at $50/month | Selected for low volume |
| MediaMTX + FFmpeg | Not natively supported | High; rebuild overlays and scene management | ~$0.10–$0.15/stream-hour for encoding CPU, excluding shared infrastructure costs | Rejected |
| Daily / 100ms / Agora | Partially supported | High; port layouts to vendor-specific systems | Similar usage-based pricing model | Rejected |
| AWS IVS Real-Time | Partially supported | High | AWS-managed pricing | Rejected |
| Browser compositing + cloud restream | Fully supported | Medium | Lowest infrastructure cost | Rejected for now |
| Custom mediasoup / Janus + GStreamer | Only after rebuilding | Very high; potentially months | Similar compute requirements | Rejected |
Why We Rejected the Alternatives
MediaMTX + FFmpeg
FFmpeg cannot directly render our React-based HTML/CSS layouts. We would need to rebuild our overlays using FFmpeg filters or another rendering pipeline.
This creates additional complexity for:
-
Dynamic overlay positioning and resizing.
-
Real-time scene changes.
-
Tibetan and Chinese text rendering.
-
Maintaining consistency between preview and broadcast.
It may reduce browser-rendering CPU costs, but the underlying encoding and bandwidth requirements remain.
Daily, 100ms, and Agora
These platforms provide managed real-time communication infrastructure, but we would need to adapt our Studio and broadcast architecture to their respective layout and egress systems.
This introduces vendor dependency without a significant architectural advantage.
AWS IVS Real-Time
IVS offers managed real-time video infrastructure, but its composition and output capabilities do not directly match our YouTube RTMP broadcasting workflow. It would require further integration or architectural changes.
Browser compositing + cloud restream
This approach renders the broadcast directly in the host’s browser and forwards it to a cloud restreaming service.
Although it can reduce infrastructure costs, the broadcast becomes dependent on the host’s computer, browser tab, and internet connection. A browser crash or network interruption can terminate the broadcast.
Building our own with mediasoup / Janus + GStreamer
This would give us flexibility, but we would essentially be rebuilding functionality that LiveKit already provides, increasing development and maintenance costs.
4. Why LiveKit Is the Best Fit
4.1 Our Product Is a Web Page
Our broadcast is not a traditional video production pipeline.
It is a React application containing:
-
Dynamic overlays.
-
Recitation text.
-
Images and QR codes.
-
Custom fonts and typography.
-
Live scene configurations.
-
Interactive visual elements.
LiveKit’s RoomComposite Egress allows us to broadcast this web application directly.
This means we do not need to maintain a separate rendering system for the broadcast.
4.2 One Stack Covers the Entire Workflow
LiveKit provides the infrastructure for:
-
Real-time rooms and participants.
-
Multiple cameras and screen sharing.
-
Data channels and room metadata.
-
Role-based authentication.
-
Browser-based compositing.
-
RTMP broadcasting.
-
Multiple streaming destinations.
-
Webhooks and lifecycle management.
Using separate services would require integrating and maintaining several independent systems.
4.3 Open Source and No Infrastructure Lock-in
LiveKit is open source under the Apache 2.0 license.
We can:
-
Self-host LiveKit and Egress for greater infrastructure control.
-
Use LiveKit Cloud when we want managed infrastructure.
-
Move between self-hosted and cloud deployments without rewriting our Studio.
This gives us flexibility to optimize costs as the product grows.
4.4 Designed for Horizontal Scaling
LiveKit Egress workers can distribute streaming jobs using Redis.
We can add more Egress workers as the number of simultaneous broadcasts increases.
Our self-hosted architecture can therefore scale independently of the Studio application.
See: livekit-egress-from-scratch.md
4.5 Alternative Solutions Do Not Eliminate the Main Costs
Regardless of the streaming technology, server-side broadcasting requires:
-
Video encoding for each independent broadcast.
-
Network bandwidth to deliver the stream to YouTube.
-
Infrastructure to manage concurrent streams.
Changing from LiveKit to another server-side solution does not eliminate these costs.
The main potential saving from FFmpeg is reducing the CPU overhead of rendering a browser page, but this comes with the cost of rebuilding our existing overlay system.
5. Trade-offs and Limitations
LiveKit is the best fit for our current architecture, but it comes with operational trade-offs.
| Trade-off | Impact | Mitigation |
|---|---|---|
| Chrome rendering is CPU-intensive | Approximately 3–4 vCPUs per 1080p stream in our current planning estimates. | Use 720p where 1080p is unnecessary and optimize browser rendering. |
| Self-hosting requires operations | We must manage Egress workers, autoscaling, monitoring, upgrades, and failures. | Use LiveKit Cloud when operational overhead becomes too high. |
| Control plane is currently a single instance | A control-plane failure could affect new sessions and management operations. | Introduce multi-node deployment with shared Redis when high availability is required. |
6. YouTube Streaming Limits
These limitations come from YouTube, not LiveKit. Switching streaming infrastructure will not remove them.
| YouTube Limitation | What It Means for Us |
|---|---|
| 10 active live streams per channel | To run 20 simultaneous broadcasts, we need at least two YouTube channels, assuming this limit applies to our account configuration. |
| 3 active streams per stream key | This does not currently affect us because our backend creates a new, single-use stream key for each broadcast (isReusable: False). |
| Daily stream creation limit | YouTube applies daily creation restrictions, but the exact limit is not publicly specified. |
| YouTube Data API quota | The default quota is 10,000 units/day. Each go-live operation currently makes approximately three write calls per channel. |
Important: YouTube account-level limits and API quotas should be verified against the actual accounts and API project before increasing production concurrency.
7. When Should We Reconsider LiveKit?
We should revisit this architectural decision when one of the following conditions occurs:
| Trigger | Possible Action |
|---|---|
| Monthly LiveKit Cloud or AWS infrastructure costs exceed ~$1,500. | Re-evaluate Cloud versus self-hosted infrastructure and alternative encoding pipelines. |
| We no longer need dynamic HTML/CSS overlays. | Consider an FFmpeg-based broadcasting pipeline. |
| Hosts can reliably broadcast from powerful desktop machines with stable internet. | Reconsider browser-based compositing and cloud restreaming. |
| We need higher availability for broadcast management. | Move the LiveKit control plane to a multi-node architecture. |
8. Final Decision
We chose LiveKit because it matches how our streaming product is built.
Our Studio is a browser-based production environment, not just a video publisher. LiveKit allows us to use the same React components for preview and broadcasting while supporting multiple cameras, remote controllers, real-time overlays, and YouTube RTMP output.
Moving to another solution would mean rebuilding parts of our existing product without necessarily reducing the most significant infrastructure costs.
For our current requirements, LiveKit provides the best balance of:
-
Product flexibility.
-
Development speed.
-
Real-time capabilities.
-
Infrastructure scalability.
-
Cost control.
-
Long-term ownership.
Our strategy: Use LiveKit Cloud when operational simplicity matters and self-hosted LiveKit when concurrency and cost justify managing our own infrastructure.
9. References
-
livekit-egress-from-scratch.md— Self-hosted autoscaling architecture. -
livekit-egress-migration.md— Egress migration checklist.
Document owner: Streaming Engineering Team