-
Notifications
You must be signed in to change notification settings - Fork 134
Add local video publisher & subcriber examples #830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds two comprehensive examples demonstrating local video capture and streaming with the LiveKit Rust SDK: a publisher that captures frames from a local camera and publishes them to a LiveKit room, and a subscriber that connects to a room and renders received video in a window with GPU acceleration.
Key changes:
- Publisher example with camera capture, format conversion (YUYV/MJPEG/RGB24 to I420), and H.264/H.265 codec support
- Subscriber example with GPU-accelerated YUV rendering using WGPU/egui and simulcast layer controls
- Enhanced yuv-sys build script to detect and enable libjpeg/libjpeg-turbo for MJPEG fast-path decoding
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| yuv-sys/build.rs | Adds pkg-config detection for system libjpeg to enable MJPEG fast-path conversion in libyuv |
| yuv-sys/Cargo.toml | Adds pkg-config dependency for build-time library detection |
| examples/local_video/Cargo.toml | New example package configuration with required dependencies for camera capture, video processing, and GPU rendering |
| examples/local_video/README.md | Documentation for both publisher and subscriber examples with usage instructions |
| examples/local_video/src/publisher.rs | Complete publisher implementation with camera capture, format detection/conversion, and LiveKit video track publishing |
| examples/local_video/src/subscriber.rs | Complete subscriber implementation with video stream reception, GPU rendering, and simulcast controls |
| examples/local_video/src/yuv_shader.wgsl | WGSL shader for YUV to RGB conversion and rendering in the subscriber |
| Cargo.toml | Adds local_video example to workspace members |
| Cargo.lock | Lock file updates for new dependencies |
| .gitignore | Adds .cursor IDE directory to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
examples/local_video/README.md
Outdated
| --api-secret YOUR_SECRET | ||
|
|
||
| # subscribe to a specific participant's video only | ||
| cargo run -p local_video --bin subscriber -- \ | ||
| --room-name demo \ | ||
| --identity viewer-1 \ | ||
| --participant alice |
Copilot
AI
Jan 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: these lines use 3 spaces while lines 40-45 above use 4 spaces (with the exception of line 45). The indentation should be consistent throughout the command blocks.
| --api-secret YOUR_SECRET | |
| # subscribe to a specific participant's video only | |
| cargo run -p local_video --bin subscriber -- \ | |
| --room-name demo \ | |
| --identity viewer-1 \ | |
| --participant alice | |
| --api-secret YOUR_SECRET | |
| # subscribe to a specific participant's video only | |
| cargo run -p local_video --bin subscriber -- \ | |
| --room-name demo \ | |
| --identity viewer-1 \ | |
| --participant alice |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This reverts commit 2a6aae3.
adding
examples/local_videoto demonstrate publishing & subscribing to video tracks using the Rust SDK.