cuddly-crowd-48028
08/22/2025, 2:21 PMtall-airline-16756
08/22/2025, 2:21 PMtall-airline-16756
08/22/2025, 2:22 PMoutput field configuration. LiveKit's egress service needs you to set up at least one output destination for recording or streaming.
Here are the main output types you can choose from:
• EncodedFileOutput: To save recordings as files (like MP4 or OGG).
• StreamOutput: For live streaming to RTMP endpoints.
• SegmentedFileOutput: For HLS/DASH segmented output.
• ImageOutput: To capture periodic snapshots or thumbnails.
For example, here’s how you can set up a file output for recording:
from livekit import api
# Configure file output for recording
req = api.RoomCompositeEgressRequest(
room_name="your-room-name",
audio_only=True,
file_outputs=[api.EncodedFileOutput(
file_type=api.EncodedFileType.OGG,
filepath="livekit/my-room-test.ogg",
s3=api.S3Upload(
bucket="<s3 bucket name>",
region="<s3 region>",
access_key="<s3 access key>",
secret="<s3 secret key>",
),
)],
)
Make sure your request includes a properly set output field. If you want, just tell me what kind of output you’re aiming for, and I’d be happy to help you get it sorted!
Sources: lib/livekit/egress_service_client.rb | Session recording and transcripts | LiveKit Docs | Egress output types | LiveKit Docs | pkg/errors/errors.go | livekit-api/livekit/api/twirp_client.pycuddly-crowd-48028
08/22/2025, 2:29 PMtall-airline-16756
08/22/2025, 2:31 PMconfig.yaml file with your settings:
# Required fields
api_key: your-livekit-server-api-key
api_secret: your-livekit-server-api-secret
ws_url: ws://your-livekit-server:7880
redis:
address: your-redis-address:6379
# Storage configuration (choose one)
storage:
s3:
access_key: your-aws-access-key
secret: your-aws-secret-key
region: us-west-2
bucket: your-egress-bucket
1. Then, run the egress service using Docker:
docker run --rm \
-e EGRESS_CONFIG_FILE=/out/config.yaml \
-v /path/to/your/config:/out \
livekit/egress
Helm Deployment (Kubernetes)
1. Add the LiveKit Helm repo:
helm repo add livekit <HELM_REPO_URL>
1. Create a values.yaml file with your details:
egress:
api_key: "your-server-api-key"
api_secret: "your-server-api-secret"
ws_url: "ws://livekit-host:7880"
redis:
address: redis-host:6379
s3:
access_key: "your-access-key"
secret: "your-secret"
region: "us-west-2"
bucket: "your-egress-bucket"
1. Finally, install the Helm chart:
helm install egress livekit/egress --namespace livekit --values values.yaml
Quick Tips for Configuration
• Make sure your API credentials match those of your LiveKit server.
• Use the same Redis instance as your LiveKit server to keep things synced.
• Don’t forget to set up at least one storage backend like S3, GCP, or Azure.
If you hit any bumps or want me to walk you through a particular step, just give me a shout—I’m here to help!
Sources: egress-sample.yaml | cmd/lk/egress.go | pkg/server/server.go | Self-hosting the Egress Service | LiveKit Docscuddly-crowd-48028
08/22/2025, 2:35 PMtall-airline-16756
08/22/2025, 2:36 PMdocker run --rm \
-e EGRESS_CONFIG_FILE=/out/config.yaml \
-v ~/egress-test:/out \
livekit/egress
1. Next, use local file paths in your egress requests by pointing to the mounted directory in your filenames (for example, /out/my-recording.mp4).
2. Make sure the mounted directory has the right permissions, since the egress service doesn’t run as root.
Local Configuration:
When testing locally, your config.yaml should leave out any cloud storage settings. The egress service will then automatically save files locally. Here’s a sample config:
log_level: debug
api_key: your-api-key
api_secret: your-api-secret
ws_url: ws://192.168.65.2:7880
insecure: true
redis:
address: 192.168.65.2:6379
This setup lets you try out all egress features, like room composites, track composites, and individual track recordings, all without needing cloud storage. If you have any questions or need a hand with anything, just let me know—I’m here to help!
Sources: test/edge.go