Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LiveKit Egress service #15

Merged
merged 6 commits into from
Jul 16, 2024
Merged

Add LiveKit Egress service #15

merged 6 commits into from
Jul 16, 2024

Conversation

lebaudantoine
Copy link
Collaborator

Purpose

Run locally the Egress service.

Proposal

Necessary for the issue #12.
I have cleaned the closed PR #13, which was a draft.
Everything is explained in commits' body.

@lebaudantoine lebaudantoine changed the title Add egress service LiveKit Egress service Jul 5, 2024
@lebaudantoine lebaudantoine self-assigned this Jul 11, 2024
@lebaudantoine lebaudantoine changed the title LiveKit Egress service Add LiveKit Egress service [PoC] Jul 11, 2024
@lebaudantoine lebaudantoine changed the title Add LiveKit Egress service [PoC] Add LiveKit Egress service Jul 11, 2024
LiveKit server configuration was the default ones. These configurations
were not connecting to any Redis instance. When running a standalone
LiveKit server, Redis is not needed.

However, when adding other LiveKit ecosystem service, e.g. Egress,
LiveKit server publish jobs to a Redis queue, that are handled by
the Egress workers.

(Precisely, they use Redis Pub/Sub to communicate but I am no expert)

The LiveKit server and the Egress need to be connected to the same
Redis instance. This commit configure the LiveKit server before
adding the Egress service to the compose stack.
LiveKit offers Universal Egress, designed to provide universal exports
of LiveKit sessions or tracks to a file or stream data.

Egress is kept outside of the server to keep the load off the SFU and avoid
impacting real-time audio or video performance/quality.

Followed the "Running Locally" steps from the https://github.com/livekit/egress
repository, but I adapted them to docker-compose.

By default, I chose to run both the LiveKit server and the Egress when you
up the stack. If we see any performance issue, we could only run the LiveKit
server, which is the barebone of the product.

Egress will be usefull only when dealing with recording/exporting data.
Egress service will output file recordings to "./docker/livekit/out"

Note: the Egress service doesn't run as root. You need to update the "/out"
permissions, so all user could write to it.
This .json file will be useful when calling the LiveKit CLI command
"start-egress", which takes a "--request" params as a path to a json file.
LiveKit CLI is essential to interact with the running server and its
ecosystem.

I recommend installing it, as you can list rooms, find participant identity,
create egress to record room, etc.

It helped a lot debugging the Egress service, and discovering its features.
Soon we will have a proper Python API, that will interact with the Egress
service.

Until this point, I shared how recording data from a meeting. So we could
extract data from the LiveKit server, and use it as sample to build the
AI pipeline.

Please note this documentation is minimal, it's a mini-tutorial.
No need to wrap string environment values in quotes.
@lebaudantoine lebaudantoine merged commit 136d380 into main Jul 16, 2024
6 of 8 checks passed
@lebaudantoine lebaudantoine deleted the add-egress branch July 16, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant