Skip to content

Commit 5a1ba5a

Browse files
committed
update readme
1 parent 867e295 commit 5a1ba5a

1 file changed

Lines changed: 40 additions & 6 deletions

File tree

examples/local_video/README.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ Publisher usage:
3030
--url https://your.livekit.server \
3131
--api-key YOUR_KEY \
3232
--api-secret YOUR_SECRET
33+
34+
# publish with a user timestamp attached to every frame
35+
cargo run -p local_video -F desktop --bin publisher -- \
36+
--camera-index 0 \
37+
--room-name demo \
38+
--identity cam-1 \
39+
--attach-timestamp
40+
41+
# publish with end-to-end encryption
42+
cargo run -p local_video -F desktop --bin publisher -- \
43+
--camera-index 0 \
44+
--room-name demo \
45+
--identity cam-1 \
46+
--e2ee-key my-secret-key
3347
```
3448

3549
List devices usage:
@@ -41,6 +55,8 @@ Publisher flags (in addition to the common connection flags above):
4155
- `--h265`: Use H.265/HEVC encoding if supported (falls back to H.264 on failure).
4256
- `--simulcast`: Publish simulcast video (multiple layers when the resolution is large enough).
4357
- `--max-bitrate <bps>`: Max video bitrate for the main (highest) layer in bits per second (e.g. `1500000`).
58+
- `--attach-timestamp`: Attach the current wall-clock time (microseconds since UNIX epoch) as the user timestamp on each published frame. The subscriber can display this to measure end-to-end latency.
59+
- `--e2ee-key <key>`: Enable end-to-end encryption with the given shared key. The subscriber must use the same key to decrypt.
4460

4561
Subscriber usage:
4662
```
@@ -55,13 +71,31 @@ Subscriber usage:
5571
--api-key YOUR_KEY \
5672
--api-secret YOUR_SECRET
5773
58-
# subscribe to a specific participant's video only
59-
cargo run -p local_video -F desktop --bin subscriber -- \
60-
--room-name demo \
61-
--identity viewer-1 \
62-
--participant alice
74+
# subscribe to a specific participant's video only
75+
cargo run -p local_video -F desktop --bin subscriber -- \
76+
--room-name demo \
77+
--identity viewer-1 \
78+
--participant alice
79+
80+
# display timestamp overlay (requires publisher to use --attach-timestamp)
81+
cargo run -p local_video -F desktop --bin subscriber -- \
82+
--room-name demo \
83+
--identity viewer-1 \
84+
--display-timestamp
85+
86+
# subscribe with end-to-end encryption (must match publisher's key)
87+
cargo run -p local_video -F desktop --bin subscriber -- \
88+
--room-name demo \
89+
--identity viewer-1 \
90+
--e2ee-key my-secret-key
6391
```
6492

93+
Subscriber flags (in addition to the common connection flags above):
94+
- `--participant <identity>`: Only subscribe to video tracks from the specified participant.
95+
- `--display-timestamp`: Show a top-left overlay with the publisher's timestamp, the subscriber's current time, and the computed end-to-end latency. Requires the publisher to use `--attach-timestamp`.
96+
- `--e2ee-key <key>`: Enable end-to-end decryption with the given shared key. Must match the key used by the publisher.
97+
6598
Notes:
66-
- `--participant` limits subscription to video tracks from the specified participant identity.
6799
- 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.
100+
- For E2EE to work, both publisher and subscriber must specify the same `--e2ee-key` value. If the keys don't match, the subscriber will not be able to decode the video.
101+
- The timestamp overlay updates at ~2 Hz so the latency value is readable rather than flickering every frame.

0 commit comments

Comments
 (0)