Skip to content

Conversation

@chenosaurus
Copy link
Contributor

adding examples/local_video to demonstrate publishing & subscribing to video tracks using the Rust SDK.

Copy link

Copilot AI left a 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.

Comment on lines 45 to 51
--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
Copy link

Copilot AI Jan 10, 2026

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.

Suggested change
--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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants