|
LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
|
Use this SDK to add realtime video, audio and data features to your C++ app. By connecting to LiveKit Cloud or a self-hosted server, you can quickly build applications such as multimodal AI, live streaming, or video calls with just a few lines of code.
CMake (≥ 3.20) is used for building the SDK itself and for consuming it as a library. The cpp-example-collection contains a reference LiveKitSDK.cmake which downloads the latest stable release at CMake configure time. See docs/building.md for additional documentation on integrating LiveKit into your project.
To build the SDK from source:
Building requires a stable Rust toolchain and platform-specific build deps (protobuf, abseil, openssl on Linux). See docs/building.md for full prerequisites table, Docker recipe, CMake presets, and troubleshooting.
Here is a minimal example of the main function for sending and receiving video and data track frames. The sender plays the role of a robot or camera, publishing video and data track frames every 100 ms; the receiver stands in for the cloud service or operator UI, logging every frame it sees. In a production system the synthetic video would be a robot's perception output and the data track would carry sensor readings or operator commands, but the connection and publishing pattern is the same. Full source for both processes lives in the cpp-example-collection repo.
The sender creates tracks and publishes data.
Initialize LiveKit and connect to the room
Create the VideoSource, which provides frames to the VideoTrack, then create and publish the VideoTrack
Create and publish the DataTrack
Publish video and data track frames every 100ms
The receiver side setup is the same, except now we set callbacks to the relevant tracks.
Initialize LiveKit and Connect to the room
Set callbacks for new video and data frames
For end-to-end samples and a fuller set of demos, see the cpp-example-collection repo.
Supported platforms: Linux (x64, arm64), macOS (12.3+, Apple Silicon & Intel), Windows (x64).
The SDK uses a thin public logging API in <livekit/logging.h> with both compile-time and runtime filtering. Plug your own sink in (file, JSON, syslog, ROS2 RCLCPP_*) via setLogCallback. See docs/logging.md.
Chromium-format performance traces can be captured with startTracing / stopTracing and viewed in chrome://tracing or ui.perfetto.dev. See docs/tracing.md.
Integration and stress test suites live under src/tests/. Build them with ./build.sh debug-tests, point LIVEKIT_URL + two participant tokens at a local livekit-server --dev, and run via ctest or directly. See docs/testing.md.
clang-tidy, clang-format, valgrind, and Doxygen are all wired up via scripts under scripts/. Set up the pre-commit auto-formatter with:
See docs/tools.md.
Future deprecations and deprecation dates will be listed here for the next major release.
>NOTE: With the official 1.0.0 release we have introduced breaking changes to previous unofficial versions in order to align with other LiveKit client SDKs. See the v1.0.0 release notes for the full list of changes.
PRs welcome. Issues: https://github.com/livekit/client-sdk-cpp/issues.
| LiveKit Ecosystem | |
|---|---|
| Agents SDKs | Python · Node.js |
| LiveKit SDKs | Browser · Swift · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL) · ESP32 · C++ |
| Starter Apps | Python Agent · TypeScript Agent · React App · SwiftUI App · Android App · Flutter App · React Native App · Web Embed |
| UI Components | React · Android Compose · SwiftUI · Flutter |
| Server APIs | Node.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community) · .NET (community) |
| Resources | Docs · Docs MCP Server · CLI · LiveKit Cloud |
| LiveKit Server OSS | LiveKit server · Egress · Ingress · SIP |
| Community | Developer Community · Slack · X · YouTube |