livekit/livekit

GitHub: livekit/livekit

开源的端到端实时音视频通信平台,为应用提供可扩展的 WebRTC 视频、音频和数据能力。

Stars: 17469 | Forks: 1779

The LiveKit icon, the name of the repository and some sample code in the background. # LiveKit:面向开发者的实时视频、音频和数据 [LiveKit](https://livekit.io) 是一个开源项目,提供基于 WebRTC 的可扩展、多用户会议功能。 它旨在为您的应用程序构建实时视频、音频和数据能力提供所需的一切。 LiveKit 服务器使用 Go 编写,采用了出色的 [Pion WebRTC](https://github.com/pion/webrtc) 实现。 [![GitHub stars](https://img.shields.io/github/stars/livekit/livekit?style=social&label=Star&maxAge=2592000)](https://github.com/livekit/livekit/stargazers/) [![Slack community](https://img.shields.io/endpoint?url=https%3A%2F%2Flivekit.io%2Fbadges%2Fslack)](https://livekit.io/join-slack) [![Twitter Follow](https://img.shields.io/twitter/follow/livekit)](https://twitter.com/livekit) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/livekit/livekit) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/livekit/livekit)](https://github.com/livekit/livekit/releases/latest) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/livekit/livekit/buildtest.yaml?branch=master)](https://github.com/livekit/livekit/actions/workflows/buildtest.yaml) [![License](https://img.shields.io/github/license/livekit/livekit)](https://github.com/livekit/livekit/blob/master/LICENSE) ## 功能特性 - 可扩展、分布式的 WebRTC SFU (Selective Forwarding Unit) - 现代、功能齐全的客户端 SDK - 为生产环境构建,支持 JWT 认证 - 强健的网络和连接性,支持 UDP/TCP/TURN - 易于部署:单一二进制文件、Docker 或 Kubernetes - 高级功能包括: - [发言人检测](https://docs.livekit.io/home/client/tracks/subscribe/#speaker-detection) - [simulcast](https://docs.livekit.io/home/client/tracks/publish/#video-simulcast) - [端到端优化](https://blog.livekit.io/livekit-one-dot-zero/) - [选择性订阅](https://docs.livekit.io/home/client/tracks/subscribe/#selective-subscription) - [管理 API](https://docs.livekit.io/home/server/managing-participants/) - 端到端加密 - SVC 编码 (VP9, AV1) - [webhooks](https://docs.livekit.io/home/server/webhooks/) - [分布式与多区域](https://docs.livekit.io/home/self-hosting/distributed/) ## 文档与指南 https://docs.livekit.io ## 在线演示 - [LiveKit Meet](https://meet.livekit.io) ([源码](https://github.com/livekit-examples/meet)) - [空间音频](https://spatial-audio-demo.livekit.io/) ([源码](https://github.com/livekit-examples/spatial-audio)) - 从 OBS Studio 直播 ([源码](https://github.com/livekit-examples/livestream)) - [使用 ChatGPT 的 AI 语音助手](https://livekit.io/kitt) ([源码](https://github.com/livekit-examples/kitt)) ## 生态系统 - [Agents](https://github.com/livekit/agents):通过可编程的后端参与者构建实时多模态 AI 应用 - [Egress](https://github.com/livekit/egress):录制或多流房间并导出单个轨道 - [Ingress](https://github.com/livekit/ingress):从 RTMP、WHIP、HLS 或 OBS Studio 等外部来源接入流 ## SDK 与工具 ### 客户端 SDK 客户端 SDK 让您的前端能够包含交互式、多用户体验。
语言 仓库 声明式 UI 链接
JavaScript (TypeScript) client-sdk-js React 文档 | JS 示例 | React 示例
Swift (iOS / MacOS) client-sdk-swift Swift UI 文档 | 示例
Kotlin (Android) client-sdk-android Compose 文档 | 示例 | Compose 示例
Flutter (所有平台) client-sdk-flutter 原生 文档 | 示例
Unity WebGL client-sdk-unity-web 文档
React Native (beta) client-sdk-react-native 原生
Rust client-sdk-rust
### 服务端 SDK 服务端 SDK 让您的后端能够生成 [访问令牌](https://docs.livekit.io/home/get-started/authentication/), 调用 [服务端 API](https://docs.livekit.io/reference/server/server-apis/),以及 接收 [webhooks](https://docs.livekit.io/home/server/webhooks/)。此外,Go SDK 包含客户端功能, 让您能够构建行为类似最终用户的自动化程序。 | 语言 | 仓库 | 文档 | | :---------------------- | :-------------------------------------------------------------------------------------- | :---------------------------------------------------------- | | Go | [server-sdk-go](https://github.com/livekit/server-sdk-go) | [文档](https://pkg.go.dev/github.com/livekit/server-sdk-go) | | JavaScript (TypeScript) | [server-sdk-js](https://github.com/livekit/server-sdk-js) | [文档](https://docs.livekit.io/server-sdk-js/) | | Ruby | [server-sdk-ruby](https://github.com/livekit/server-sdk-ruby) | | | Java (Kotlin) | [server-sdk-kotlin](https://github.com/livekit/server-sdk-kotlin) | | | Python (社区) | [python-sdks](https://github.com/livekit/python-sdks) | | | PHP (社区) | [agence104/livekit-server-sdk-php](https://github.com/agence104/livekit-server-sdk-php) | | ### 工具 - [CLI](https://github.com/livekit/livekit-cli) - 命令行界面与负载测试工具 - [Docker 镜像](https://hub.docker.com/r/livekit/livekit-server) - [Helm charts](https://github.com/livekit/livekit-helm) ## 安装 以下命令将安装 LiveKit 的媒体服务器: ### MacOS ``` brew install livekit ``` ### Linux ``` curl -sSL https://get.livekit.io | bash ``` ### Windows 在[此处下载最新版本](https://github.com/livekit/livekit/releases/latest) ## 快速开始 ### 启动 LiveKit 通过运行 `livekit-server --dev` 以开发模式启动 LiveKit。它将使用占位符 API 密钥/密钥对。 ``` API Key: devkey API Secret: secret ``` 若要为生产环境自定义配置,请参阅我们的[部署文档](https://docs.livekit.io/deploy/) ### 创建访问令牌 连接到 LiveKit 房间的用户需要一个 [访问令牌](https://docs.livekit.io/home/get-started/authentication/#creating-a-token)。访问 令牌 (JWT) 编码了用户的身份及其被授予的房间权限。您可以使用我们的 CLI 生成令牌: ``` lk token create \ --api-key devkey --api-secret secret \ --join --room my-first-room --identity user1 \ --valid-for 24h ``` ### 使用示例应用测试 前往我们的[示例应用](https://example.livekit.io)并输入生成的令牌以连接到您的 LiveKit 服务器。此应用使用我们的 [React SDK](https://github.com/livekit/livekit-react) 构建。 连接成功后,您的视频和音频将发布到您新的 LiveKit 实例! ### 模拟测试发布者 ``` lk room join \ --url ws://localhost:7880 \ --api-key devkey --api-secret secret \ --identity bot-user1 \ --publish-demo \ my-first-room ``` 此命令向房间发布循环播放的演示视频。由于视频片段的编码方式(每 3 秒一个关键帧), 浏览器在拥有足够数据开始渲染帧之前会有轻微延迟。这是 模拟的一个特征。 ## 部署 ### 使用 LiveKit Cloud LiveKit Cloud 是运行 LiveKit 最快、最可靠的方式。每个项目均可获得免费的每月带宽和 转码额度。 注册 [LiveKit Cloud](https://cloud.livekit.io/)。 ### 自托管 阅读我们的[部署文档](https://docs.livekit.io/transport/self-hosting/)了解更多信息。 ## 从源码构建 前置条件: - 已安装 Go 1.23+ - GOPATH/bin 位于您的 PATH 中 然后运行 ``` git clone https://github.com/livekit/livekit cd livekit ./bootstrap.sh mage ``` ## 贡献 我们欢迎您为改进 LiveKit 做出贡献!请加入我们 [在 Slack 上](http://livekit.io/join-slack)讨论您的想法和/或 PR。 ## 许可证 LiveKit 服务器根据 Apache License v2.0 授权。
LiveKit 生态系统
LiveKit SDKsBrowser · iOS/macOS/visionOS · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL) · ESP32
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community) · NET (community)
UI ComponentsReact · Android Compose · SwiftUI · Flutter
Agents FrameworksPython · Node.js · Playground
ServicesLiveKit server · Egress · Ingress · SIP
ResourcesDocs · Example apps · Cloud · Self-hosting · CLI
标签:AI语音助手, EVTX分析, EVTX分析, Go语言, JWT认证, LiveKit, Pion, SFU, VoIP, WebRTC, 人机交互, 代理服务器, 低延迟, 分布式系统, 即时通讯, 可视化界面, 响应大小分析, 多用户互动, 子域名突变, 实时通信, 实时音视频, 开源, 数据通道, 日志审计, 流媒体服务器, 程序破解, 端到端实时, 视频会议, 视频流, 请求拦截, 远程连接, 逆向工具, 音视频开发, 音频处理