@@ -23,7 +23,7 @@ curl -sSL https://get.livekit.io/cli | bash
2323
2424## Windows
2525
26- Download [ latest release here] ( https://github.com/livekit/livekit-cli/releases/latest )
26+ Download the [ latest release here] ( https://github.com/livekit/livekit-cli/releases/latest )
2727
2828## Build from source
2929
@@ -38,14 +38,39 @@ make install
3838
3939See ` livekit-cli --help ` for a complete list of subcommands.
4040
41+ ## Set up your project [ new]
42+
43+ livekit-cli introduces the concept of projects, where it could save your connection information including API keys and secrets.
44+
45+ When a default project is set up, you can omit ` url ` , ` api-key ` , and ` api-secret ` when using the CLI.
46+ You could also set up multiple projects, and switch the active project used with the ` --project ` flag.
47+
48+ ### Adding a project
49+
50+ ``` shell
51+ livekit-cli project add
52+ ```
53+
54+ ### Listing projects
55+
56+ ``` shell
57+ livekit-cli project list
58+ ```
59+
60+ ### Switching defaults
61+
62+ ``` shell
63+ livekit-cli project set-default < project-name>
64+ ```
65+
4166## Publishing to a room
4267
4368### Publish demo video track
4469
4570To publish a demo video as a participant's track, use the following.
4671
4772``` shell
48- % livekit-cli join-room --room yourroom --identity publisher \
73+ livekit-cli join-room --room yourroom --identity publisher \
4974 --publish-demo
5075```
5176
@@ -57,7 +82,7 @@ You can publish your own audio/video files. These tracks files need to be encode
5782Refer to [ encoding instructions] ( https://github.com/livekit/server-sdk-go/tree/main#publishing-tracks-to-room )
5883
5984``` shell
60- % livekit-cli join-room --room yourroom --identity publisher \
85+ livekit-cli join-room --room yourroom --identity publisher \
6186 --publish path/to/video.ivf \
6287 --publish path/to/audio.ogg \
6388 --fps 23.98
@@ -75,7 +100,7 @@ This is done by running FFmpeg in a separate process, encoding to a Unix socket.
75100First run FFmpeg like this:
76101
77102``` shell
78- $ ffmpeg -i < video-file | rtsp://url> \
103+ ffmpeg -i < video-file | rtsp://url> \
79104 -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -profile:v baseline -pix_fmt yuv420p \
80105 -x264-params keyint=120 -max_delay 0 -bf 0 \
81106 -listen 1 -f h264 unix:/tmp/myvideo.sock \
@@ -88,7 +113,7 @@ This transcodes the input into H.264 baseline profile and Opus.
88113Then, run ` livekit-cli ` like this:
89114
90115``` shell
91- $ livekit-cli join-room --room yourroom --identity bot \
116+ livekit-cli join-room --room yourroom --identity bot \
92117 --publish h264:///tmp/myvideo.sock \
93118 --publish opus:///tmp/myaudio.sock
94119````
@@ -102,7 +127,7 @@ It's possible to publish from video streams coming over a TCP socket. `livekit-c
102127Run `livekit-cli` like this:
103128
104129```shell
105- $ livekit-cli join-room --room yourroom --identity bot \
130+ livekit-cli join-room --room yourroom --identity bot \
106131 --publish h264:///127.0.0.1:16400
107132```
108133
@@ -114,7 +139,7 @@ a format that WebRTC clients could playback (VP8, H.264, and Opus).
114139Once you are writing to the socket, you could use ` ffplay` to test the stream.
115140
116141` ` ` shell
117- $ ffplay -i unix:/tmp/myvideo.sock
142+ ffplay -i unix:/tmp/myvideo.sock
118143` ` `
119144
120145# # Recording & egress
@@ -125,13 +150,13 @@ Example request.json files are [located here](https://github.com/livekit/livekit
125150
126151` ` ` shell
127152# start room composite (recording of room UI)
128- livekit-cli start-room-composite-egress --url < your-url > --api-key < key > --api-secret < secret > -- request request.json
153+ livekit-cli start-room-composite-egress --request request.json
129154
130155# start track composite (audio + video)
131- livekit-cli start-track-composite-egress --url < your-url > --api-key < key > --api-secret < secret > -- request request.json
156+ livekit-cli start-track-composite-egress --request request.json
132157
133158# start track egress (single audio or video track)
134- livekit-cli start-track-egress --url < your-url > --api-key < key > --api-secret < secret > -- request request.json
159+ livekit-cli start-track-egress --request request.json
135160` ` `
136161
137162# ## Testing egress templates
@@ -145,12 +170,9 @@ It'll then open a browser to the template URL, with the correct parameters fille
145170Here' s an example:
146171
147172` ` ` shell
148- $ livekit-cli test-egress-template
173+ livekit-cli test-egress-template \
149174 --base-url http://localhost:3000 \
150- --url < livekit-instance>
151- --api-key < key>
152- --api-secret < secret>
153- --room < your-room> --layout < your-layout> --publishers 3
175+ --room < your-room> --layout < your-layout> --video-publishers 3
154176` ` `
155177
156178This command will launch a browser pointed at ` http://localhost:3000` , while simulating 3 publishers publishing to your livekit instance.
@@ -166,20 +188,31 @@ Note: `livekit-load-tester` has been renamed to sub-command `livekit-cli load-te
166188This guide requires a LiveKit server instance to be set up. You can start a load tester with:
167189
168190` ` ` shell
169- $ livekit-cli load-test --url < your-url> \
170- --api-key < key> --api-secret < secret> \
171- --room test-room --publishers 24
191+ livekit-cli load-test \
192+ --room test-room --video-publishers 8
172193` ` `
173194
174195This simulates 8 video publishers to the room, with no subscribers. Video tracks are published with simulcast, at 720p, 360p, and 180p.
175196
197+ # ### Simulating audio publishers
198+
199+ To test audio capabilities in your app, you can also simulate simultaneous speakers to the room.
200+
201+ ` ` ` shell
202+ livekit-cli load-test \
203+ --room test-room --audio-publishers 5
204+ ` ` `
205+
206+ The above simulates 5 concurrent speakers, each playing back a pre-recorded audio sample at the same time.
207+ In a meeting, typically there' s only one active speaker at a time, but this can be useful to test audio capabilities.
208+
176209#### Watch the test
177210
178211Generate a token so you can log into the room:
179212
180213```shell
181- $ livekit-cli create-token --join --api-key < key > --api-secret < secret > \
182- --room test-room --identity user
214+ livekit-cli create-token --join \
215+ --room test-room --identity user
183216```
184217
185218Head over to the [example web client](https://example.livekit.io) and paste in the token, you can see the simulated tracks published by the load tester.
@@ -218,11 +251,9 @@ of data sent to its subscribers.
218251Use this command to simulate a load test of 5 publishers, and 500 subscribers:
219252
220253```shell
221- $ livekit-cli load-test --url < your-url> \
222- --api-key < key> \
223- --api-secret < secret> \
254+ livekit-cli load-test \
224255 --duration 1m \
225- --publishers 5 \
256+ --video- publishers 5 \
226257 --subscribers 500
227258```
228259
@@ -247,10 +278,10 @@ Summary | Tester | Tracks | Bitrate | Latency | Total Dr
247278
248279You could customize various parameters of the test such as
249280
250- - --publishers: number of publishers
251- - --subscribers : number of publishers
252- - --audio-bitrate: publishing audio bitrate; 0 to disable
253- - --video-resolution: publishing video resolution. low, medium, high; none to disable
281+ - --video- publishers: number of video publishers
282+ - --audio-publishers : number of audio publishers
283+ - --subscribers: number of subscribers
284+ - --video-resolution: publishing video resolution. low, medium, high
254285- --no-simulcast: disables simulcast
255286- --num-per-second: number of testers to start each second
256287- --layout: layout to simulate (speaker, 3x3, 4x4, or 5x5)
0 commit comments