Giter Club home page Giter Club logo

livekit-cli's Introduction

The LiveKit icon, the name of the repository and some sample code in the background.

LiveKit CLI

This package includes command line utilities that interacts with LiveKit. It allows you to:

  • Create access tokens
  • Access LiveKit APIs, create, delete rooms, etc
  • Join a room as a participant, inspecting in-room events
  • Start and manage Egress
  • Perform load testing, efficiently simulating real-world load

Installation

Mac

brew install livekit-cli

Linux

curl -sSL https://get.livekit.io/cli | bash

Windows

Download the latest release here

Build from source

This repo uses Git LFS for embedded video resources. Please ensure git-lfs is installed on your machine.

git clone https://github.com/livekit/livekit-cli
make install

Usage

See livekit-cli --help for a complete list of subcommands.

Set up your project [new]

When a default project is set up, you can omit url, api-key, and api-secret when using the CLI. You could also set up multiple projects, and switch the active project used with the --project flag.

Adding a project

livekit-cli project add

Listing projects

livekit-cli project list

Switching defaults

livekit-cli project set-default <project-name>

Publishing to a room

Publish demo video track

To publish a demo video as a participant's track, use the following.

livekit-cli join-room --room yourroom --identity publisher \
  --publish-demo

It'll publish the video track with simulcast, at 720p, 360p, and 180p.

Publish media files

You can publish your own audio/video files. These tracks files need to be encoded in supported codecs. Refer to encoding instructions

livekit-cli join-room --room yourroom --identity publisher \
  --publish path/to/video.ivf \
  --publish path/to/audio.ogg \
  --fps 23.98

This will publish the pre-encoded ivf and ogg files to the room, indicating video FPS of 23.98. Note that the FPS only affects the video; it's important to match video framerate with the source to prevent out of sync issues.

Note: For files uploaded via CLI, expect an initial delay before the video becomes visible to the remote viewer. This delay is attributed to the pre-encoded video's fixed keyframe intervals. Video encoded with LiveKit client SDKs do not have this delay.

Publish from FFmpeg

It's possible to publish any source that FFmpeg supports (including live sources such as RTSP) by using it as a transcoder.

This is done by running FFmpeg in a separate process, encoding to a Unix socket. (not available on Windows). livekit-cli can then read transcoded data from the socket and publishing them to the room.

First run FFmpeg like this:

ffmpeg -i <video-file | rtsp://url> \
  -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -profile:v baseline -pix_fmt yuv420p \
    -x264-params keyint=120 -max_delay 0 -bf 0 \
    -listen 1 -f h264 unix:/tmp/myvideo.sock \
  -c:a libopus -page_duration 20000 -vn \
  	-listen 1 -f opus unix:/tmp/myaudio.sock

This transcodes the input into H.264 baseline profile and Opus.

Then, run livekit-cli like this:

livekit-cli join-room --room yourroom --identity bot \
  --publish h264:///tmp/myvideo.sock \
  --publish opus:///tmp/myaudio.sock

You should now see both video and audio tracks published to the room.

Publish from TCP (i.e. gstreamer)

It's possible to publish from video streams coming over a TCP socket. livekit-cli can act as a TCP client. For example, with a gstreamer pipeline ending in ! tcpserversink port=16400 and streaming H.264.

Run livekit-cli like this:

livekit-cli join-room --room yourroom --identity bot \
  --publish h264:///127.0.0.1:16400

Publish streams from your application

Using unix sockets, it's also possible to publish streams from your application. The tracks need to be encoded into a format that WebRTC clients could playback (VP8, H.264, and Opus).

Once you are writing to the socket, you could use ffplay to test the stream.

ffplay -i unix:/tmp/myvideo.sock

Recording & egress

Recording requires egress service to be set up first.

Example request.json files are located here.

# start room composite (recording of room UI)
livekit-cli start-room-composite-egress --request request.json

# start track composite (audio + video)
livekit-cli start-track-composite-egress --request request.json

# start track egress (single audio or video track)
livekit-cli start-track-egress --request request.json

Testing egress templates

In order to speed up the development cycle of your recording templates, we provide a sub-command test-egress-template that helps you to validate your templates.

The command will spin up a few virtual publishers, and then simulate them joining your room It'll then open a browser to the template URL, with the correct parameters filled in.

Here's an example:

livekit-cli test-egress-template \
  --base-url http://localhost:3000 \
  --room <your-room> --layout <your-layout> --video-publishers 3

This command will launch a browser pointed at http://localhost:3000, while simulating 3 publishers publishing to your livekit instance.

Load Testing

Load testing utility for LiveKit. This tool is quite versatile and is able to simulate various types of load.

Note: livekit-load-tester has been renamed to sub-command livekit-cli load-test

Quickstart

This guide requires a LiveKit server instance to be set up. You can start a load tester with:

livekit-cli load-test \
  --room test-room --video-publishers 8

This simulates 8 video publishers to the room, with no subscribers. Video tracks are published with simulcast, at 720p, 360p, and 180p.

Simulating audio publishers

To test audio capabilities in your app, you can also simulate simultaneous speakers to the room.

livekit-cli load-test \
  --room test-room --audio-publishers 5

The above simulates 5 concurrent speakers, each playing back a pre-recorded audio sample at the same time. In a meeting, typically there's only one active speaker at a time, but this can be useful to test audio capabilities.

Watch the test

Generate a token so you can log into the room:

livekit-cli create-token --join \
  --room test-room --identity user  

Head over to the example web client and paste in the token, you can see the simulated tracks published by the load tester.

Load tester screenshot

Running on a cloud VM

Due to bandwidth limitations of your ISP, most of us wouldn't have sufficient bandwidth to be able to simulate 100s of users download/uploading from the internet.

We recommend running the load tester from a VM on a cloud instance, where there isn't a bandwidth constraint.

To make this simple, make will generate a linux amd64 binary in bin/. You can scp the binary to a server instance and run the test there.

Configuring system settings

Prior to running the load tests, it's important to ensure file descriptor limits have been set correctly. See Performance tuning docs.

On the machine that you are running the load tester, they would also need to be applied:

ulimit -n 65535
sysctl -w fs.file-max=2097152
sysctl -w net.core.somaxconn=65535
sysctl -w net.core.rmem_max=25165824
sysctl -w net.core.wmem_max=25165824

Simulate subscribers

You can run the load tester on multiple machines, each simulating any number of publishers or subscribers.

LiveKit SFU's performance is measured by the amount of data sent to its subscribers.

Use this command to simulate a load test of 5 publishers, and 500 subscribers:

livekit-cli load-test \
  --duration 1m \
  --video-publishers 5 \
  --subscribers 500

It'll print a report like the following. (this run was performed on a 16 core, 32GB memory VM)

Summary | Tester  | Tracks    | Bitrate                 | Latency     | Total Dropped
        | Sub 0   | 10/10     | 2.2mbps                 | 78.86829ms  | 0 (0%)
        | Sub 1   | 10/10     | 2.2mbps                 | 78.796542ms | 0 (0%)
        | Sub 10  | 10/10     | 2.2mbps                 | 79.361718ms | 0 (0%)
        | Sub 100 | 10/10     | 2.2mbps                 | 79.449831ms | 0 (0%)
        | Sub 101 | 10/10     | 2.2mbps                 | 80.001104ms | 0 (0%)
        | Sub 102 | 10/10     | 2.2mbps                 | 79.833373ms | 0 (0%)
...
        | Sub 97  | 10/10     | 2.2mbps                 | 79.374331ms | 0 (0%)
        | Sub 98  | 10/10     | 2.2mbps                 | 79.418816ms | 0 (0%)
        | Sub 99  | 10/10     | 2.2mbps                 | 79.768568ms | 0 (0%)
        | Total   | 5000/5000 | 678.7mbps (1.4mbps avg) | 79.923769ms | 0 (0%)

Advanced usage

You could customize various parameters of the test such as

  • --video-publishers: number of video publishers
  • --audio-publishers: number of audio publishers
  • --subscribers: number of subscribers
  • --video-resolution: publishing video resolution. low, medium, high
  • --no-simulcast: disables simulcast
  • --num-per-second: number of testers to start each second
  • --layout: layout to simulate (speaker, 3x3, 4x4, or 5x5)
  • --simulate-speakers: randomly rotate publishers to speak


LiveKit Ecosystem
Real-time SDKsReact Components · JavaScript · iOS/macOS · Android · Flutter · React Native · Rust · Python · Unity (web) · Unity (beta)
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community)
Agents FrameworksPython · Playground
ServicesLivekit server · Egress · Ingress · SIP
ResourcesDocs · Example apps · Cloud · Self-hosting · CLI

livekit-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

livekit-cli's Issues

source installetion is not working

Describe the bug
source installetion is not working

Server
i use EndeavourOS Linux x86_64

To Reproduce

git clone https://github.com/livekit/livekit-cli
make install

Logs

kaushiksahu18 ◉ cd livekit-cli/
kaushiksahu18 ◉ make install
make: go: No such file or directory
go build -ldflags "-w -s" -o bin/livekit-cli ./cmd/livekit-cli
/bin/sh: line 1: go: command not found
make: *** [Makefile:8: cli] Error 127

Could not start writing - "IVF signature mismatc"

I apologize if this is user error, but I have been trying to convert an rtsp feed to vp8 using gstreamer. I have tried several different pipelines out and while they seem to work, when I attempt to join a room I get the following error and the video does not stream.

"msg"="Could not start writing" "error"="IVF signature mismatch"

Steps to reproduce:

gst-launch-1.0 videotestsrc is-live=true pattern=ball ! videoconvert ! vp8enc ! tcpserversink port=16400
livekit-cli join-room --room my-first-room --identity bot  \
  --publish vp8://localhost:16400 \
  --api-key devkey --api-secret secret

Subscribers parameter is not working on load test

Screen Shot 2022-11-10 at 14 38 12

When not add --subscribers parameter to load test command, duration is working and it is ending after given time.

Screen Shot 2022-11-10 at 14 40 45

But if --subscribers added, duration is not works and set 100h automatically. And when check the room just publishers is in the room not subs. So it is not able to get report.

Screen Shot 2022-11-10 at 14 41 56

livekit-cli version 1.2.2

data is not a H264 bitstream via GStreamer

The documentation suggests I can stream H264 from GStreamer to a livekit client via the following:

Pipeline:
gst-launch-1.0 videotestsrc ! videoconvert ! x264enc bitrate=500 ! video/x-h264,profile=baseline ! tcpserversink host=127.0.0.1 port=16400

Client:
livekit-cli join-room --identity user1 --publish h264://127.0.0.1:16400 --api-key "devkey" --api-secret "secret" --room my-first-room

My pipeline runs and intuitively looks fine, however the livekit-cli responds with the following error message:
"msg"="could not get sample from provider" "error"="data is not a H264 bitstream"

I believe it is attaching to the intended place; it finds nothing if I take the pipeline down.

I may be misunderstanding the intended functionality but the documentation does not elucidate any further.

Thanks in advance for any help.

[Question] My config is not working

Please help to correct my config:

root@server:/opt/livekit# livekit-cli project list
+--------+------------------------------------+-----------------+---------+
| NAME | URL | API KEY | DEFAULT |
+--------+------------------------------------+-----------------+---------+
| test | http://mydomain.site:8000 | APIXKuQx9w0234dse | true |
+--------+------------------------------------+-----------------+---------+
root@server:/opt/livekit# livekit-cli list-rooms
Using default project test
twirp error bad_route: Error from intermediary with HTTP status code 404 "Not Found"

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • golang 1.22-alpine
  • alpine 3.20
github-actions
.github/workflows/build.yaml
  • actions/checkout v4
  • actions/cache v4
  • actions/setup-go v5
  • dominikh/staticcheck-action v1.3.1
.github/workflows/docker.yaml
  • actions/checkout v4
  • docker/metadata-action v5
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/build-push-action v5
.github/workflows/install-test.yaml
  • actions/checkout v4
.github/workflows/release.yaml
  • actions/checkout v4
  • actions/cache v4
  • actions/setup-go v5
  • goreleaser/goreleaser-action v6
gomod
go.mod
  • go 1.22
  • go 1.22.2
  • github.com/frostbyte73/core v0.0.10
  • github.com/go-logr/logr v1.4.2
  • github.com/livekit/protocol v1.15.0
  • github.com/livekit/server-sdk-go/v2 v2.1.3-0.20240507072004-e3121c9908be@e3121c9908be
  • github.com/manifoldco/promptui v0.9.0
  • github.com/olekukonko/tablewriter v0.0.5
  • github.com/pion/rtcp v1.2.14
  • github.com/pion/rtp v1.8.5
  • github.com/pion/webrtc/v3 v3.2.40
  • github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c@5ac0b6a4141c
  • github.com/pkg/errors v0.9.1
  • github.com/stretchr/testify v1.9.0
  • github.com/twitchtv/twirp v8.1.3+incompatible
  • github.com/urfave/cli/v2 v2.27.1
  • go.uber.org/atomic v1.11.0
  • golang.org/x/sync v0.7.0
  • golang.org/x/time v0.5.0
  • google.golang.org/protobuf v1.34.1
  • gopkg.in/yaml.v3 v3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

egress start record not working "twirp error deadline_exceeded: request timed out"

Hi, I have a problem with recording room or track.
If I use cli for ROOM:

livekit-cli start-room-composite-egress --request  room.json 
Using default project room2
twirp error deadline_exceeded: request timed out
cat room.json 
{
  "room_name": "yourroom",
  "file": {
    "file_type": "MP4",
    "filepath": "/out/track-composite-test.mp4"
  }
}

for TRACK:

livekit-cli start-track-composite-egress --request request.json 
Using default project room2
twirp error deadline_exceeded: request timed out
cat request.json 
{
  "room_name": "room1",
  "audio_track_id": "TR_AMf9TpUUReYTAM",
  "video_track_id": "TR_VCXkwuWf3DB5St",
  "file": {
    "file_type": "MP4",
    "filepath": "/out/track-composite-test.mp4"
  }
}

I thought, that were bad right or setting about IP or port for Egress, Redis or Livekit.
But If a call list-egress- result is correct.
On client side I used CLI or client-sdk-js example - all it's work.
It's local installation for testing.

Tell me, please, what's wrong? I see

	// DeadlineExceeded means operation expired before completion. For operations
	// that change the state of the system, this error may be returned even if the
	// operation has completed successfully (timeout).
	DeadlineExceeded ErrorCode = "deadline_exceeded"

But not understand - what server is slow. Result file doesn't appear. List-egress on CLI and API are working

livekit-cli list-egress 
Using default project room2
+----------+--------+------+--------+------------+-------+
| EGRESSID | STATUS | TYPE | SOURCE | STARTED AT | ERROR |
+----------+--------+------+--------+------------+-------+
+----------+--------+------+--------+------------+-------+

Starting EGRESS

sudo docker run --rm     -e EGRESS_CONFIG_FILE=/out/config.yaml     -v ~/egress:/out  -v ~/livekit-egress:/record livekit/egress
+ rm -rf '/home/egress/tmp/*'
+ rm -rf /var/run/pulse /var/lib/pulse /home/egress/.config/pulse /home/egress/.cache/xdgr/pulse
+ pulseaudio -D --verbose --exit-idle-time=-1 --disallow-exit
I: [pulseaudio] main.c: Daemon startup successful.
+ exec egress
2024-01-12T07:38:25.679Z	INFO	egress	redis/redis.go:127	connecting to redis	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": "", "simple": true, "addr": "172.17.0.1:6379"}
2024-01-12T07:38:25.681Z	INFO	egress	stats/monitor.go:130	cpu available: 12.000000 max cost: 4.000000	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": ""}
2024-01-12T07:38:25.682Z	DEBUG	egress	service/debug.go:38	debug handler disabled	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": ""}
2024-01-12T07:38:25.682Z	DEBUG	egress	service/service.go:94	starting service	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": "", "version": "1.8.0"}
2024-01-12T07:38:25.682Z	DEBUG	egress	service/templates_server.go:38	starting template server on address localhost:7980	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": ""}
2024-01-12T07:38:25.683Z	INFO	egress	service/service.go:100	service ready	{"nodeID": "NE_oSYhQjBiThQq", "clusterID": ""}

cat ~/egress/config.yaml 
log_level: debug
redis:
  address: 172.17.0.1:6379
insecure: true
api_key: devkey
api_secret: secret
ws_url: ws://172.17.0.1:7880

LIVEKIT_SERVER START:

livekit-server --dev --redis-host=172.17.0.1:6379 --bind 0.0.0.0
2024-01-12T10:37:55.157+0300	INFO	livekit	server/main.go:212	starting in development mode
2024-01-12T10:37:55.158+0300	INFO	livekit	server/main.go:215	no keys provided, using placeholder keys	{"API Key": "devkey", "API Secret": "secret"}
2024-01-12T10:37:55.159+0300	INFO	livekit	redis/redis.go:127	connecting to redis	{"simple": true, "addr": "172.17.0.1:6379"}

panic: runtime error: slice bounds out of range [-7:]

I execute code to use load test and it print panic

code:

./livekit-load-tester --url http://10.64.31.31:7880 --api-key=API4TNGcc8K8KXt --api-secret=qDTSklbwfwpEv3y8vhq6emRdnud5hLvbUilmxvz4Bva --room testroom --duration 1m  --publishers 10 --subscribers 10 --identity-prefix tes

panic:

panic: runtime error: slice bounds out of range [-7:]

goroutine 230 [running]:
github.com/livekit/livekit-cli/pkg/loadtester.(*LoadTester).consumeTrack(0xc000334480, 0xc000238900)
 /root/livekit-cli-main/pkg/loadtester/loadtester.go:186 +0x40c
created by github.com/livekit/livekit-cli/pkg/loadtester.(*LoadTester).onTrackSubscribed
 /root/livekit-cli-main/pkg/loadtester/loadtester.go:171 +0x505
panic: runtime error: slice bounds out of range [-7:]

goroutine 484 [running]:
github.com/livekit/livekit-cli/pkg/loadtester.(*LoadTester).consumeTrack(0xc0004465a0, 0xc0008605a0)
 /root/livekit-cli-main/pkg/loadtester/loadtester.go:186 +0x40c
created by github.com/livekit/livekit-cli/pkg/loadtester.(*LoadTester).onTrackSubscribed
 /root/livekit-cli-main/pkg/loadtester/loadtester.go:171 +0x505

livekit-cli load-test failing with panic

When attempting to load test, I get the follow output when video is involved. Audio only works fine.

> livekit-cli load-test --url <url> --room load-test --publishers 1 --subscribers 1 --video-resolution low --audio-bitrate 45000 --api-key <apiKey> --api-secret <apiSecret> --video-codec h264 --duration 1m

Starting load test with 1 publishers, 1 subscribers, room: load-test
panic: non-positive interval for Ticker.Reset

I did set the relevant variables for load-testing:

ulimit -n 65535
sysctl -w fs.file-max=2097152
sysctl -w net.core.somaxconn=65535
sysctl -w net.core.rmem_max=25165824
sysctl -w net.core.wmem_max=2516582

Ability to load test at 1080p

It would be great for my use case to test publishing 1080p video using the load-test command.

Proposing a very-high option be added to serve this use case

live-kit-cli: vp8 TCP input gives "error"="IVF signature mismatch"

Hi folks,

as shown in this thread it is perfectly possible to publish H.264 NAL units from a GStreamer pipeline to livekit-server via livekit-cli:

https://livekit-users.slack.com/archives/C01KVTJH6BX/p1700642085369689?thread_ts=1700500341.249709&cid=C01KVTJH6BX

The same seems to be not possible, since livekit-cli fires

2023/11/23 10:07:51 "msg"="Could not start writing" "error"="IVF signature mismatch"

Gstreamer Pipeline:

gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, width=1280, height=720, framerate=30/1 ! videoconvert ! vp8enc deadline=1 ! tcpserversink port=16400

livekit-cli call:

livekit-cli join-room --url ws://localhost:7880 --api-key devkey --api-secret secret --room abcde --identity bot --publish vp8://localhost:16400

Load tester fails with invalid memory address or nil pointer dereference

I'm trying to test my Livekit instance using the load tester, but it always almost crashes. Using a small number of publishers and subscribers does not make it crash, like 5 publishers and 10 subscribers, but with more, it basically always crashes.

[signal SIGSEGV: segmentation violation code=0x2 addr=0x38 pc=0x102d1122c]

goroutine 57048 [running]:
github.com/livekit/server-sdk-go.(*Room).GetParticipants(0x14014ff72c0?)
	github.com/livekit/[email protected]/room.go:199 +0x3c
github.com/livekit/livekit-cli/pkg/loadtester.(*LoadTester).onTrackSubscribed(0x1400c5104d0, 0x1401ba4d200, 0x1401b504f70, 0x1401b3fc790)
	github.com/livekit/livekit-cli/pkg/loadtester/loadtester.go:251 +0x40
github.com/livekit/server-sdk-go.(*RemoteParticipant).addSubscribedMediaTrack(0x1401b3fc790, 0x1401ba4d200, {0x1401a722705, 0x11}, 0x1401bd41260)
	github.com/livekit/[email protected]/remoteparticipant.go:109 +0x268
github.com/livekit/server-sdk-go.(*Room).handleMediaTrack(0x0?, 0x1401ea01380?, 0x140266c26c0?)
	github.com/livekit/[email protected]/room.go:246 +0xd8
github.com/livekit/server-sdk-go.(*RTCEngine).configure.func4(0x14011bc1b60?, 0x0?)
	github.com/livekit/[email protected]/engine.go:171 +0x30
created by github.com/pion/webrtc/v3.(*PeerConnection).onTrack
	github.com/pion/webrtc/[email protected]/peerconnection.go:461 +0x1d8
➜  ~ livekit-cli --version
livekit-cli version 1.0.2

livkit-cli to support the video-codec vp9

The latest version of livekit-cli version 1.2.10 does not support the video-codec vp9. Requesting to have support the support of vp9. Below is the only two option of video codec present currently.

h264
vp8

Support for TCP socket

My use case is to feed gstreamer H264 encoded data to livekit. I saw that Unix socket support was added in #25

I made a quick branch to support TCP sockets using tcp:address string format, similar to the existing unix:socket_file format.

The one thing that's missing however, is the mime type detection. For Unix sockets they are inferred based on strings in the filename. For TCP this approach is less feasible.

See my changes here: https://github.com/livekit/livekit-cli/compare/main...bsirang:livekit-cli:bsirang/sockets?expand=1

Perhaps the format can be changed to socket_type:mime_type:address?

--identity-prefix option of load-test does not work.

I used the --identity-prefix option in the liveki-cli load-test subcommand, but it doesn't take effect.
As shown below, the participant's identity should be prefixed with foo, but it is ignored and a random string called aejbl is prefixed.

$ livekit-cli load-test --verbose --room 1 --video-publishers 1 --subscribers 1 --identity-prefix foo
Using default project {}
URL: {}, api-key: {}, api-secret: {}
Starting load test with 1 video publishers, 1 subscribers, room: 1
2023/08/01 10:56:13 "level"=0 "msg"="received offer for subscriber"
2023/08/01 10:56:14 "level"=0 "msg"="received offer for subscriber"
2023/08/01 10:56:14 "level"=0 "msg"="ICE connected"
publishing simulcast video track - aejbl_pub_0
2023/08/01 10:56:14 "level"=0 "msg"="published simulcast track" "name"="video-simulcast" "source"="CAMERA"
2023/08/01 10:56:14 "level"=0 "msg"="successfully set publisher answer"
2023/08/01 10:56:14 "level"=0 "msg"="received offer for subscriber"
2023/08/01 10:56:15 "level"=0 "msg"="ICE connected"
Finished connecting to room, waiting 1000h0m0s
2023/08/01 10:56:15 "level"=0 "msg"="track subscribed" "participant"="aejbl_pub_0" "track"="TR_VCHPrH9do6BTnz" "kind"="video"
subscribed to track aejbl_1 TR_VCHPrH9do6BTnz video 1/1

Error starting RTMP Stream

Hey guys,
we are trying to get FoundryVTT running with Livekit. Our Goal is to get RTMP up and running (egress is working according to systemctl status), however, when I try to start an egress, I get an error message:

root@livekit:/opt/livekit# livekit-cli start-room-composite-egress --request ./rtmp.json
Using default project ProjectName
twirp error internal: failed to do request: Post "http://example.com/twirp/livekit.Egress/StartRoomCompositeEgress": dial tcp 127.0.1.1:80: connect: connection refused

The RTMP.json looks like this:

{ "room_name": "my-room", "layout": "speaker-dark", "stream": { "urls": [ "rtmp://example.com/x" ] } }

What do I have to do differently to make it work, so that we can import the RTMP Stream into OBS?

Kind Regards

Zero

No Latency Times for CLI Benchmark

Replication

  • livekit-cli version 0.7.1
  • macOS Monterey 12.3

Tested against livekit server with the 15.4 release using the following command

livekit-load-tester --url wss://<HOST> \
  --api-key <KEY> \
  --api-secret <SECRET> \
  --duration 1m \
  --publishers 3 \
  --subscribers 5

Result

Sub 0 | Track              | Kind  | Pkts  | Bitrate   | Latency | Dropped
      | 0A TR_Ly3y4PeTMwSw | audio | 1795  | 9.8kbps   |  -      | 0 (0%)
      | 0V TR_Nu25DAFUofuL | video | 12051 | 1.8mbps   |  -      | 0 (0%)
      | 1A TR_Jyf7uj2VrTRu | audio | 1765  | 9.8kbps   |  -      | 0 (0%)
      | 1V TR_DL22PuDNcTtK | video | 1425  | 152.0kbps |  -      | 0 (0%)
      | 2A TR_JdW49DAcempW | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 2V TR_ZZ3xVM9sU6mQ | video | 1430  | 153.2kbps |  -      | 0 (0%)

Sub 1 | Track              | Kind  | Pkts  | Bitrate   | Latency | Dropped
      | 0A TR_Ly3y4PeTMwSw | audio | 1795  | 9.8kbps   |  -      | 0 (0%)
      | 0V TR_Nu25DAFUofuL | video | 12051 | 1.8mbps   |  -      | 0 (0%)
      | 1A TR_Jyf7uj2VrTRu | audio | 1765  | 9.8kbps   |  -      | 0 (0%)
      | 1V TR_DL22PuDNcTtK | video | 1425  | 152.0kbps |  -      | 0 (0%)
      | 2A TR_JdW49DAcempW | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 2V TR_ZZ3xVM9sU6mQ | video | 1430  | 153.2kbps |  -      | 0 (0%)

Sub 2 | Track              | Kind  | Pkts  | Bitrate   | Latency | Dropped
      | 0A TR_Ly3y4PeTMwSw | audio | 1795  | 9.8kbps   |  -      | 0 (0%)
      | 0V TR_Nu25DAFUofuL | video | 12051 | 1.8mbps   |  -      | 0 (0%)
      | 1A TR_Jyf7uj2VrTRu | audio | 1765  | 9.8kbps   |  -      | 0 (0%)
      | 1V TR_DL22PuDNcTtK | video | 1425  | 152.0kbps |  -      | 0 (0%)
      | 2A TR_JdW49DAcempW | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 2V TR_ZZ3xVM9sU6mQ | video | 1430  | 153.2kbps |  -      | 0 (0%)

Sub 3 | Track              | Kind  | Pkts  | Bitrate   | Latency | Dropped
      | 0A TR_Ly3y4PeTMwSw | audio | 1775  | 9.8kbps   |  -      | 0 (0%)
      | 0V TR_Nu25DAFUofuL | video | 1409  | 152.1kbps |  -      | 0 (0%)
      | 1A TR_Jyf7uj2VrTRu | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 1V TR_DL22PuDNcTtK | video | 11930 | 1.8mbps   |  -      | 0 (0%)
      | 2A TR_JdW49DAcempW | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 2V TR_ZZ3xVM9sU6mQ | video | 1430  | 153.2kbps |  -      | 0 (0%)

Sub 4 | Track              | Kind  | Pkts  | Bitrate   | Latency | Dropped
      | 0A TR_Ly3y4PeTMwSw | audio | 1776  | 9.8kbps   |  -      | 0 (0%)
      | 0V TR_Nu25DAFUofuL | video | 1208  | 120.1kbps |  -      | 0 (0%)
      | 1A TR_Jyf7uj2VrTRu | audio | 1765  | 9.8kbps   |  -      | 0 (0%)
      | 1V TR_DL22PuDNcTtK | video | 11930 | 1.8mbps   |  -      | 0 (0%)
      | 2A TR_JdW49DAcempW | audio | 1766  | 9.8kbps   |  -      | 0 (0%)
      | 2V TR_ZZ3xVM9sU6mQ | video | 1430  | 153.2kbps |  -      | 0 (0%)

Summary | Tester | Tracks | Bitrate                | Latency | Total Dropped
        | Sub 0  | 6/6    | 2.1mbps                |  -      | 0 (0%)
        | Sub 1  | 6/6    | 2.1mbps                |  -      | 0 (0%)
        | Sub 2  | 6/6    | 2.1mbps                |  -      | 0 (0%)
        | Sub 3  | 6/6    | 2.1mbps                |  -      | 0 (0%)
        | Sub 4  | 6/6    | 2.1mbps                |  -      | 0 (0%)
        | Total  | 30/30  | 10.4mbps (2.1mbps avg) |  -      | 0 (0%)

Expected:

Latency times to be reported

Error when running livekit-load-tester on v0.8.0

I was trying to run this command:

livekit-load-tester \
       --url wss://wss.example.com \
       --api-key my_api_key \
       --api-secret my_api_secret \
       --duration 1m \
       --publishers 1 \
       --subscribers 5

Then, I was getting this error:

Starting load test with 1 publishers, 5 subscribers, room:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0xa8172e]

goroutine 572 [running]:
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).nextSample(0xc000335b00, 0x1)
        /root/go/pkg/mod/github.com/livekit/[email protected]/pkg/provider/h264looper.go:77 +0x38e
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).NextSample(0xc000335b00?)
        /root/go/pkg/mod/github.com/livekit/[email protected]/pkg/provider/h264looper.go:54 +0x48
github.com/livekit/server-sdk-go.(*LocalSampleTrack).writeWorker(0xc0003cfad0, {0x7fcfd9be30c0, 0xc000335b00}, 0x0)
        /root/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:395 +0x1c7
created by github.com/livekit/server-sdk-go.(*LocalSampleTrack).Bind
        /root/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:185 +0x57b

My current solution is to just downgrade to v0.7.2
go install github.com/livekit/livekit-cli/cmd/[email protected]

Ffmpeg latency and gstreamer pipeline "green screen"

I'm trying to use ffmpeg or gstreamer to send a screen capture stream to a livekit room.

I have some issues / questions regarding that:

  • I'm using TCP or unix socket publishing with FFmpeg: the stream can be played well into my livekit room, but I have 5 seconds of latency when I watch the video.
    Is it normal or have you got a shortest latency on your side?

  • When I test TCP publishing with GStreamer (I can't do it with the unix socket), I've got some frames but most of frames are greens.

Maybe my gstreamer pipeline was not good, so I did some research and I stumbled upon it :
https://github.com/pion/example-webrtc-applications/tree/master/gstreamer-send
The sample works great with VP8 and H264, I did a fork to test if H264 was ok (be careful, you must install more some gst plugin to be able to test H264 ), I have a classical webRTC latency (less than 1 second).

I have logged video pipeline (not so far that mine) and used the same pipeline with livekit-cli TCP :
gst-launch-1.0 -v ximagesrc remote=1 use-damage=0 ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=20 ! video/x-h264,stream-format=byte-stream ! tcpserversink port=16400 host=127.0.0.1

The same issue occurs.

I saw that there is a discussion here: (I hesitated to post here)
livekit/server-sdk-go#20
and I didn't see the pion gstreamer-send implementation as an example. I am not yet very familiar with go and livekit/pion but can we work on an implementation close to pion gstreamer send ?

Loadtest issue

in the react example app the websockets address is working as it should, but when running the load tester, i get an got websocket: bad handshake when run

below is the command i run

./livekit-load-tester --url wss://xxx.com --api-key xxxx --api-secret xxxxxxxxx --room test --publishers 1 --subscribers 20

any help on this would be awesome

thanks advance

Jason

I need help with some error message

I can't figure it out what to do.

I'm using:

apiUrl = http://localhost
apiPort = 7880
and the appropiate api key and secret

Then when i want to create a room using:

livekit-cli create-room --url ${apiUrl}:${apiPort} --api-key ${apiKey} --api-secret ${apiSecret} --name ${roomName}

I got this message:
"twirp error internal: could not create room: could not find any available nodes"

Still... the room is created. But I'm not sure if I'm supposed to get this message

Then i tried to delete the room using:

livekit-cli delete-room --api-key ${apiKey} --api-secret ${apiSecret} --room ${roomName}

And it just hangs there doing nothing

And when i use:

livekit-cli list-rooms --api-key ${apiKey} --api-secret ${apiSecret}

It brings the room already created

Help plz

Load test publishers don't trigger ActiveSpeakersChanged event

When I'm testing a LiveKit room locally running livekit-server --dev and livekit-cli load-test, the publishers don't seem to trigger the ActiveSpeakersChanged event. It would help to have at least an option to trigger that as well.

Using latest version of the server, cli, and the JS SDK running on latest macOS.

version 1.1.0 [signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0xb0070a]

Hello,

it seems that this problem persists on v 1.1.0 :

Starting load test with 1 publishers, 25 subscribers, room: test-room
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0xb0070a]

goroutine 157 [running]:
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).nextSample(0xc000397050, 0x1)
        /root/livekit-cli/pkg/provider/h264looper.go:77 +0x3ea
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).NextSample(0xc000397050?)
        /root/livekit-cli/pkg/provider/h264looper.go:54 +0x48
github.com/livekit/server-sdk-go.(*LocalSampleTrack).writeWorker(0xc0004ea820, {0x7fced0085a78, 0xc000397050}, 0x0)
        /root/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:395 +0x1c7
created by github.com/livekit/server-sdk-go.(*LocalSampleTrack).Bind
        /root/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:185 +0x57b

Please add tag 0.6.1

go install github.com/livekit/livekit-cli/cmd/livekit-cli@latest install version 0.6.0

Using access token with livekit-cli

Currently, to publish stream, livekit-cli requires api-key and api-secret. But for security purpose, I want to only provide access-token. How can I achieve this?

Simulcast with ffmpeg

is it possible to publish a stream from ffmpeg with multiple bitrates and have simulcast available on this stream ?

Load Test fails with SIGSEGV

When running livekit-cli load-test, independant of the amount of subscribers, publishers or other settings, this error occurs:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0x16c9031]

goroutine 235 [running]:
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).nextSample(0xc000474ab0, 0x1)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:77 +0x3f1
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).NextSample(0xc000474ab0)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:54 +0x54
github.com/livekit/server-sdk-go.(*LocalSampleTrack).writeWorker(0xc00084c680, {0xddd7d78, 0xc000474ab0}, 0x0)
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:395 +0x1c7
created by github.com/livekit/server-sdk-go.(*LocalSampleTrack).Bind
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:185 +0x571
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0x16c9031]

goroutine 239 [running]:
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).nextSample(0xc000474c00, 0x1)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:77 +0x3f1
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).NextSample(0xc000474c00)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:54 +0x54
github.com/livekit/server-sdk-go.(*LocalSampleTrack).writeWorker(0xc00084c820, {0xddd7d78, 0xc000474c00}, 0x0)
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:395 +0x1c7
created by github.com/livekit/server-sdk-go.(*LocalSampleTrack).Bind
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:185 +0x571
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x6 pc=0x16c9031]

goroutine 237 [running]:
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).nextSample(0xc000474ba0, 0x1)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:77 +0x3f1
github.com/livekit/livekit-cli/pkg/provider.(*H264VideoLooper).NextSample(0xc000474ba0)
	/Users/christiaangoossens/Projects/Livekit/livekit-cli/pkg/provider/h264looper.go:54 +0x54
github.com/livekit/server-sdk-go.(*LocalSampleTrack).writeWorker(0xc00084c750, {0xddd7d78, 0xc000474ba0}, 0x0)
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:395 +0x1c7
created by github.com/livekit/server-sdk-go.(*LocalSampleTrack).Bind
	/Users/christiaangoossens/go/pkg/mod/github.com/livekit/[email protected]/localsampletrack.go:185 +0x571

installetion script is not working

Describe the bug
installetion script is not working

Server
i use EndeavourOS Linux x86_64

To Reproduce
i have use this "curl -sSL https://get.livekit.io/cli | bash"

Logs

curl -sSL https://get.livekit.io/cli | bash
sudo is required to install to /usr/local/bin
Installing livekit-cli 1.4.3
Downloading from https://github.com/livekit/livekit-cli/releases/download/v1.4.3/livekit-cli_1.4.3_linux_amd64.tar.gz...
[sudo] password for kaushiksahu18:
mv: cannot create regular file '/usr/local/bin/livekit-cli': Permission denied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.