From 0c55f4a6e1da1947890f54695818ae0bc3edacf2 Mon Sep 17 00:00:00 2001 From: antoine lebaud Date: Fri, 5 Jul 2024 16:43:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(livekit)=20run=20locally=20Egress=20s?= =?UTF-8?q?ervice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .gitignore | 3 +++ docker-compose.yml | 11 +++++++++++ docker/livekit/config/livekit-egress.yaml | 7 +++++++ docker/livekit/out/.gitkeep | 0 4 files changed, 21 insertions(+) create mode 100644 docker/livekit/config/livekit-egress.yaml create mode 100644 docker/livekit/out/.gitkeep diff --git a/.gitignore b/.gitignore index 24643946..7802cf6c 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,6 @@ db.sqlite3 .vscode/ *.iml .devcontainer + +# Egress output +docker/livekit/out diff --git a/docker-compose.yml b/docker-compose.yml index f5df29f4..f287fc73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -162,3 +162,14 @@ services: - ./docker/livekit/config/livekit-server.yaml:/config.yaml depends_on: - redis + - livekit-egress + + livekit-egress: + image: livekit/egress + environment: + EGRESS_CONFIG_FILE: ./livekit-egress.yaml + volumes: + - ./docker/livekit/config/livekit-egress.yaml:/livekit-egress.yaml + - ./docker/livekit/out:/out + depends_on: + - redis diff --git a/docker/livekit/config/livekit-egress.yaml b/docker/livekit/config/livekit-egress.yaml new file mode 100644 index 00000000..0505d1de --- /dev/null +++ b/docker/livekit/config/livekit-egress.yaml @@ -0,0 +1,7 @@ +log_level: debug +api_key: devkey +api_secret: secret +ws_url: "ws://livekit:7880" +insecure: true +redis: + address: redis:6379 diff --git a/docker/livekit/out/.gitkeep b/docker/livekit/out/.gitkeep new file mode 100644 index 00000000..e69de29b