Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ad2c841
wip
chenosaurus Oct 28, 2025
664d4b3
wip publishing from local camera
chenosaurus Oct 28, 2025
af08d3f
clean up warnings
chenosaurus Oct 28, 2025
dff3168
generated protobuf
github-actions[bot] Oct 28, 2025
9f1ebe6
support UYUV format
chenosaurus Oct 29, 2025
8b5eeba
Merge branch 'dc/local_camera' of github.com:livekit/rust-sdks into d…
chenosaurus Oct 29, 2025
1a808e7
update protocol
chenosaurus Oct 29, 2025
ae42dfb
generated protobuf
github-actions[bot] Oct 29, 2025
5838296
remove UYVY
chenosaurus Oct 30, 2025
6e3b953
Merge branch 'dc/local_camera' of github.com:livekit/rust-sdks into d…
chenosaurus Oct 30, 2025
16e624a
remove extraneous feature
chenosaurus Oct 30, 2025
5d39dde
wip fixing mjpeg decode
chenosaurus Oct 30, 2025
27b8705
revert removal of feature, does not connect w/o it
chenosaurus Oct 30, 2025
03a6499
wip
chenosaurus Oct 30, 2025
7cb75e9
experiement with mjpg -> I420 conversino
chenosaurus Oct 30, 2025
4db0ae4
add conversion path for I400 -> I420
chenosaurus Oct 30, 2025
60daefa
try to open camera in GREY
chenosaurus Oct 30, 2025
6069a91
add more logging
chenosaurus Oct 30, 2025
9529512
clean up
chenosaurus Oct 30, 2025
6929eda
remove grey support for now
chenosaurus Oct 30, 2025
77ef1df
try h265
chenosaurus Nov 1, 2025
2aaa175
eanble h265 on nvidia gpu
chenosaurus Nov 1, 2025
ac007d2
add includes
chenosaurus Nov 1, 2025
2aead1c
add HEVC
chenosaurus Nov 1, 2025
8066f37
improve subscriber example render performance
chenosaurus Nov 1, 2025
1640c8a
wip
chenosaurus Nov 1, 2025
1563038
missing files
chenosaurus Nov 1, 2025
450d56b
fixes
chenosaurus Nov 1, 2025
12a730b
enable simulcast in example
chenosaurus Nov 2, 2025
f2a9ed3
print out track details
chenosaurus Nov 2, 2025
bf5ec21
add --participant flag to subscriber example
chenosaurus Nov 13, 2025
a202edd
add bitrate option to publisher
chenosaurus Nov 13, 2025
9afe58b
disable simulcast
chenosaurus Nov 13, 2025
2f3e578
Merge branch 'main' into dc/nvenc_h265_test
chenosaurus Nov 21, 2025
0974c73
wip adding simulcast layer select buttons
chenosaurus Nov 25, 2025
588c847
simulcast ui controls
chenosaurus Dec 3, 2025
93c075c
wip
chenosaurus Dec 4, 2025
b11cf98
working ex
chenosaurus Dec 4, 2025
951ef59
add e2ee key config
chenosaurus Dec 4, 2025
ab3a055
measure latency along pipeline
chenosaurus Dec 4, 2025
69cb8dc
add video render to publisher
chenosaurus Dec 10, 2025
c004961
add timestamp render on the video
chenosaurus Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
522 changes: 469 additions & 53 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ members = [
"examples/basic_text_stream",
"examples/encrypted_text_stream",
"examples/local_audio",
"examples/local_video",
"examples/mobile",
"examples/play_from_disk",
"examples/rpc",
Expand Down
41 changes: 41 additions & 0 deletions examples/local_video/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[package]
name = "local_video"
version = "0.1.0"
edition = "2021"
publish = false

[[bin]]
name = "publisher"
path = "src/publisher.rs"

[[bin]]
name = "subscriber"
path = "src/subscriber.rs"

[dependencies]
tokio = { version = "1", features = ["full", "parking_lot"] }
livekit = { workspace = true, features = ["rustls-tls-native-roots"] }
webrtc-sys = { workspace = true }
libwebrtc = { workspace = true }
livekit-api = { workspace = true }
yuv-sys = { workspace = true }
futures = "0.3"
clap = { version = "4.5", features = ["derive"] }
log = "0.4"
env_logger = "0.10.0"
nokhwa = { version = "0.10", default-features = false, features = ["input-avfoundation", "input-v4l", "input-msmf", "output-threaded"] }
image = "0.24"
egui = "0.31.1"
egui-wgpu = "0.31.1"
eframe = { version = "0.31.1", default-features = false, features = ["default_fonts", "wgpu", "persistence"] }
wgpu = "25.0"
winit = { version = "0.30.11", features = ["android-native-activity"] }
parking_lot = { version = "0.12.1", features = ["deadlock_detection"] }
anyhow = "1"
bytemuck = { version = "1.16", features = ["derive"] }
time = { version = "0.3", features = ["macros", "formatting"] }

[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.6.0", features = ["relax-sign-encoding"] }


50 changes: 50 additions & 0 deletions examples/local_video/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# local_video

Two examples demonstrating capturing frames from a local camera video and publishing to LiveKit, and subscribing to render video in a window.

- publisher: capture from a selected camera and publish a video track
- subscriber: connect to a room, subscribe to video tracks, and display in a window

LiveKit connection can be provided via flags or environment variables:
- `--url` or `LIVEKIT_URL`
- `--api-key` or `LIVEKIT_API_KEY`
- `--api-secret` or `LIVEKIT_API_SECRET`

Publisher usage:
```
cargo run -p local_video --bin publisher -- --list-cameras
cargo run -p local_video --bin publisher -- --camera-index 0 --room-name demo --identity cam-1

# with explicit LiveKit connection flags
cargo run -p local_video --bin publisher -- \
--camera-index 0 \
--room-name demo \
--identity cam-1 \
--url https://your.livekit.server \
--api-key YOUR_KEY \
--api-secret YOUR_SECRET
```

Subscriber usage:
```
# relies on env vars LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET
cargo run -p local_video --bin subscriber -- --room-name demo --identity viewer-1

# or pass credentials via flags
cargo run -p local_video --bin subscriber -- \
--room-name demo \
--identity viewer-1 \
--url https://your.livekit.server \
--api-key YOUR_KEY \
--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
```

Notes:
- `--participant` limits subscription to video tracks from the specified participant identity.
- If the active video track is unsubscribed or unpublished, the app clears its state and will automatically attach to the next matching video track when it appears.
Loading