You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/local_video/README.md
+40-6Lines changed: 40 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,20 @@ Publisher usage:
30
30
--url https://your.livekit.server \
31
31
--api-key YOUR_KEY \
32
32
--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
33
47
```
34
48
35
49
List devices usage:
@@ -41,6 +55,8 @@ Publisher flags (in addition to the common connection flags above):
41
55
-`--h265`: Use H.265/HEVC encoding if supported (falls back to H.264 on failure).
42
56
-`--simulcast`: Publish simulcast video (multiple layers when the resolution is large enough).
43
57
-`--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.
44
60
45
61
Subscriber usage:
46
62
```
@@ -55,13 +71,31 @@ Subscriber usage:
55
71
--api-key YOUR_KEY \
56
72
--api-secret YOUR_SECRET
57
73
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
63
91
```
64
92
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
+
65
98
Notes:
66
-
-`--participant` limits subscription to video tracks from the specified participant identity.
67
99
- 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