early-restaurant-74591
10/13/2025, 12:04 AMtall-airline-16756
10/13/2025, 12:04 AMtall-airline-16756
10/13/2025, 12:05 AMconfig.yaml) or by using environment variables like AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION.
• For example, your config.yaml might look like this:
s3:
access_key: 'your-access-key'
secret: 'your-secret-key'
region: 'us-east-1'
bucket: 'your-bucket-name'
2. Per-Request Configuration:
• If you prefer, you can specify the S3 details directly in the egress request. Here’s how it looks when starting a room composite egress:
{
"file": {
"filepath": "recordings/{room_name}.mp4",
"s3": {
"access_key": "your-access-key",
"secret": "your-secret-key",
"region": "us-east-1",
"bucket": "your-bucket-name"
}
}
}
3. Security Best Practices:
• To keep things secure, it's best to use IAM roles or environment variables instead of embedding your sensitive credentials directly in API calls.
• Good news for LiveKit Cloud users: egress is enabled by default, so once you’ve set up S3, your recordings will be uploaded automatically.
If you have any questions or need a hand with any of these steps, please don’t hesitate to reach out — I’m here to help!
Sources: pkg/config/storage.go | cmd/lk/examples/auto-track-egress.json | app/api/record/start/route.ts | auth/grants_test.go | Recording and export | LiveKit Docsearly-restaurant-74591
10/13/2025, 12:07 AMearly-restaurant-74591
10/13/2025, 12:07 AMtall-airline-16756
10/13/2025, 12:07 AM{
"file": {
"filepath": "recordings/{room_name}.mp4",
"s3": {
"access_key": "your-access-key",
"secret": "your-secret-key",
"region": "us-east-1",
"bucket": "your-bucket-name"
}
}
}
2. Use Environment Variables:
Another friendly option is to set these environment variables in your system or deployment environment:
• AWS_ACCESS_KEY_ID
• AWS_SECRET_ACCESS_KEY
• AWS_DEFAULT_REGION
These will be picked up automatically by the egress service, making things a bit easier.
If you’d like, I’m here to help with any step or answer any questions you have—just let me know!tall-airline-16756
10/13/2025, 12:07 AM{
"file": {
"filepath": "recordings/{room_name}.mp4",
"s3": {
"access_key": "your-access-key",
"secret": "your-secret-key",
"region": "us-east-1",
"bucket": "your-bucket-name"
}
}
}
If you'd rather set up global S3 credentials once and avoid repeating them every time, you can use environment variables such as AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION.
I'm here to help if you want to walk through either option together—just let me know!early-restaurant-74591
10/13/2025, 12:10 AMtall-airline-16756
10/13/2025, 12:10 AMS3Upload class within the right output configuration. Here’s a helpful example for a room composite egress:
from livekit.protocol.egress import RoomCompositeEgressRequest, EncodedFileOutput, S3Upload
request = RoomCompositeEgressRequest(
room_name="my-room",
file=EncodedFileOutput(
filepath="recordings/output.mp4",
s3=S3Upload(
access_key="your-access-key",
secret="your-secret-key",
bucket="your-bucket",
region="us-west-2"
)
)
)
Just be sure to swap out the placeholders with your real S3 credentials and bucket info. If anything feels unclear or you’d like a hand with the next steps, I’m here to help!
Sources: cmd/lk/examples/web-egress.json | Universal Egress | Egress API | LiveKit Docsearly-restaurant-74591
10/13/2025, 12:13 AMtall-airline-16756
10/13/2025, 12:13 AMAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY), that's great—that should be all you need. The egress service will automatically use these credentials for S3 uploads, so there’s no need to pass them with every egress request.
That said, if you ever want to override the default credentials for specific requests, you can include the S3 details directly in the egress request payload. This step is optional and only necessary if you want to use different credentials or settings for certain tasks.
Please feel free to reach out if you'd like me to explain anything further or if you have any other questions—I’m here to help!early-restaurant-74591
10/13/2025, 12:15 AMtall-airline-16756
10/13/2025, 12:16 AMAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION environment variables are correctly set in your agent's task definition.
• Also, make sure the S3 bucket name and region exactly match your setup.
2. Inspect the Error Message:
• LiveKit includes an Error field in the EgressInfo object when you see EGRESS_FAILED. This can give clues if the problem is with authentication, connectivity, or configuration.
3. Debugging Steps:
• Try enabling S3 debug logging by setting the aws_log_level to LogDebug in your S3 configuration—it often helps reveal what's going on behind the scenes.
• Keep an eye on webhook notifications for EventEgressEnded events, as they include detailed error info.
• It might also help to test outputting to a local file (like /out/test.mp4) to see if the issue is specific to S3.
4. Verify S3 Permissions:
• Make sure the IAM user or role tied to your credentials has PutObject permissions for the S3 bucket.
• Also, check if any bucket policies might be restricting uploads.
5. Compare Environments:
• Since egress works fine in your development environment, it’s a good idea to compare configurations—like credentials, network settings, and S3 bucket details—between dev and production to spot any differences.
If you’d like, I’m here to help with any particular step or to clarify anything further. Just let me know!
Sources: Egress API | LiveKit Docs | livekit-protocol/livekit/protocol/egress.pyi | pkg/config/base.go | examples/egress.yaml | pkg/rtc/egress.go