icy-beard-64788
12/06/2025, 5:21 AMtall-airline-16756
12/06/2025, 5:21 AMtall-airline-16756
12/06/2025, 5:21 AMicy-beard-64788
12/06/2025, 5:22 AMtall-airline-16756
12/06/2025, 5:22 AMsession_token along with access_key and secret in the `S3Upload`/egress S3 configuration.
• The temporary credentials must grant the required S3 permissions (e.g., s3:PutObject) for the target bucket.
• Ensure the credentials remain valid for the entire duration of the recording/egress operation.
Would you like an example JSON snippet for the egress S3 config or help generating short-lived credentials (STS) for your use case?
Sources: Egress output types | LiveKit docs | Egress API | LiveKit docsicy-beard-64788
12/06/2025, 5:23 AMtall-airline-16756
12/06/2025, 5:23 AMAccessKeyId, SecretAccessKey, and SessionToken. Ensure the credentials allow s3:PutObject on the target bucket and will remain valid for the test duration.
2) Start a simple egress request (JSON example)
• Use the egress API that your deployment exposes. In the S3 config include access_key, secret, and session_token. Example body for a recording to S3:
{
"room": "test-room",
"output": {
"s3": {
"bucket": "my-test-bucket",
"region": "us-west-2",
"access_key": "TEMP_ACCESS_KEY_ID",
"secret": "TEMP_SECRET_ACCESS_KEY",
"session_token": "TEMP_SESSION_TOKEN",
"key": "recordings/test-room-{time}.mp4"
}
},
"recording": {
"type": "file",
"format": "mp4"
}
}
• Replace placeholders with your values. Submit this request to your LiveKit egress endpoint (e.g., POST /egress or your provider’s equivalent).
3) Generate activity in the room
• Join the test-room with 1–2 clients (web or SDK) and publish audio/video so there’s content to record. Keep the temporary creds valid while the recording runs.
4) Verify upload and recording
• Watch the egress job status / logs in your LiveKit egress responses. When finished, confirm the object appears in S3 at the configured key.
• If upload fails, check the egress error message and verify:
◦ session_token and other creds are correct and unexpired
◦ IAM permissions include s3:PutObject (and s3:PutObjectAcl if needed)
◦ Bucket name, region, and object key are correct
5) Quick troubleshooting checklist
• Credential expiry: increase STS duration or shorten test if token expired
• Clock skew: ensure server/system clocks are in sync
• Permissions: test the same creds with an AWS CLI aws s3 cp to the bucket to confirm rights
Would you like a ready-to-send POST request for your specific LiveKit egress endpoint (share the endpoint and bucket/region, or tell me which SDK/HTTP tool you’ll use)?icy-beard-64788
12/06/2025, 5:24 AMtall-airline-16756
12/06/2025, 5:24 AMroomJoin: true and the room name, then toJwt() to get the token.
• Connect from the client with the token and your WS URL (e.g., wss://your-project.livekit.cloud).
◦ Client action: connect, then enable camera/mic or publish tracks.
2) Obtain temporary AWS credentials
• Create an IAM role or call AWS STS to get AccessKeyId, SecretAccessKey, and SessionToken.
• Ensure the credentials allow s3:PutObject (and any other required S3 actions) on the target bucket.
• Make the token duration long enough to cover the recording.
3) Start an Egress (S3) using temporary creds
• In your egress request include access_key, secret, and session_token in the S3 config, plus bucket, region, and `key`/`filepath`.
• Minimal JSON example for a room-composite MP4:
{
"room_name": "test-room",
"file": {
"file_type": "MP4",
"filepath": "recordings/test-recording.mp4",
"s3": {
"access_key": "TEMP_ACCESS_KEY_ID",
"secret": "TEMP_SECRET_ACCESS_KEY",
"session_token": "TEMP_SESSION_TOKEN",
"region": "us-west-2",
"bucket": "my-recordings-bucket"
}
}
}
• Submit this to your LiveKit egress endpoint or use the LiveKit CLI / SDK to start room composite egress.
4) Quick test steps
1. Generate tokens for 1–2 participants and connect clients to test-room.
2. Start the egress with the JSON above while participants publish audio/video.
3. Keep the temporary creds valid while recording runs.
4. Stop the egress manually or end the room—egress may stop automatically when the room ends.
5) Verify the upload
• Use aws s3 ls s3://my-recordings-bucket/recordings/ to confirm the MP4 appears.
• Or receive the egress_ended webhook event showing the S3 bucket and key.
6) Quick troubleshooting checklist
• Confirm session_token included and not expired.
• Confirm IAM policy allows s3:PutObject.
• Check bucket name, region, and object key.
• Check server clock for skew if you see signature errors.
• Test the temporary creds with aws s3 cp from the machine starting egress to validate permissions.
If you’d like, I can now:
• Provide a ready-to-send POST request tailored to your LiveKit egress endpoint, or
• Give a full client code example for Web, iOS, Android, Node, or Go.
Which do you want next?
Sources: RoomComposite Egress | LiveKit Docs | server-sdk-ruby | livekit/livekit_composite | DeepWikiicy-beard-64788
12/06/2025, 5:28 AMtall-airline-16756
12/06/2025, 5:28 AMicy-beard-64788
12/06/2025, 5:28 AMtall-airline-16756
12/06/2025, 5:29 AMtest-room and identity agent-playground-user. Keep the token ready.
2) Open Agents Playground and join
• Paste the token (or the full connect URL if playground accepts it) into the playground’s join field and connect.
• Enable camera/mic in the UI (your link already enables cam/mic/video/audio; confirm permissions in the browser).
3) Obtain temporary S3 creds
• Create an IAM role or use STS to get AccessKeyId, SecretAccessKey, and SessionToken.
• Ensure the role allows s3:PutObject on your bucket and the token expiry covers the test.
4) Start egress from the playground (or from your server/CLI if playground doesn’t expose egress)
• If playground has a console/egress UI: open its egress panel, choose Room Composite (MP4), and fill S3 fields with access_key, secret, and session_token, plus bucket, region, and key (e.g., recordings/test.mp4). Start egress.
• If playground does not expose egress: run the egress request from your server or use the LiveKit CLI with the JSON below.
Example egress JSON (use with your egress endpoint or CLI):
{
"room_name": "test-room",
"file": {
"file_type": "MP4",
"filepath": "recordings/test-recording.mp4",
"s3": {
"access_key": "TEMP_ACCESS_KEY_ID",
"secret": "TEMP_SECRET_ACCESS_KEY",
"session_token": "TEMP_SESSION_TOKEN",
"region": "us-west-2",
"bucket": "my-recordings-bucket"
}
}
}
5) Generate media in the room
• From the playground, speak and enable video so there’s content to record.
6) Verify results
• After egress ends, check S3: aws s3 ls s3://my-recordings-bucket/recordings/
• Or watch for the egress_ended webhook (if configured) showing the S3 key.
If you want, I can:
• Provide a ready-to-run token generator snippet for Node or Go,
• Produce the exact POST command for your egress endpoint or the LiveKit CLI command, or
• Walk you through getting STS temporary creds.
Which of those would you like next?icy-beard-64788
12/06/2025, 5:32 AMtall-airline-16756
12/06/2025, 5:33 AMsession_token and proper JSON shape):
curl -X POST https://<your-livekit-host>/twirp/livekit.Egress/StartRoomCompositeEgress \
-H "Authorization: Bearer <livekit-access-token>" \
-H "Content-Type: application/json" \
-d '{
"room_name":"your-room",
"segments": {
"filename_prefix":"your-hls-playlist.m3u8",
"s3": {
"access_key":"TEMP_ACCESS_KEY_ID",
"secret":"TEMP_SECRET_ACCESS_KEY",
"session_token":"TEMP_SESSION_TOKEN",
"bucket":"your-bucket",
"region":"your-bucket-region"
}
}
}'
Required items
• LiveKit access token with permission to start egress.
• Temporary AWS creds: access_key, secret, and session_token (STS). Ensure s3:PutObject for the bucket.
• filename_prefix is the HLS master playlist name; segments and playlists will be written under that prefix.
Quick verification steps
• Watch the egress response for an egress_id and final status.
• Check S3: aws s3 ls s3://your-bucket/<prefix>/ to see .m3u8 and .ts files.
• Optionally receive the egress_ended webhook which includes the S3 key.
Troubleshooting tips
• If you get signature or access errors, confirm session_token is present and unexpired, and server clock is correct.
• Test the temporary creds with aws s3 cp from the machine running egress to confirm permissions.
Would you like:
• A ready-to-run token generator snippet (Node or Go), or
• A ready POST request/CLI command populated with your host, bucket, and region?icy-beard-64788
12/06/2025, 5:34 AMtall-airline-16756
12/06/2025, 5:35 AMlivekit.example.com)
• or the LiveKit Cloud project domain (example: your-project.livekit.cloud)
Example with a real-looking host: https://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress
Notes:
• Use HTTPS and include the Authorization header with a LiveKit access token that can start egress.
• If your LiveKit instance runs on a nonstandard port, include it (e.g., `https://livekit.example.com:7880/...`).
Would you like a complete curl example filled with your host, room name, and bucket so you can run it immediately?icy-beard-64788
12/06/2025, 5:37 AMtall-airline-16756
12/06/2025, 5:38 AMcurl -X POST "https://<YOUR_LIVEKIT_HOST>/twirp/livekit.Egress/StartRoomCompositeEgress" \
-H "Authorization: Bearer <LIVEKIT_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"room_name": "<ROOM_NAME>",
"segments": {
"filename_prefix": "<PREFIX/playlist.m3u8>",
"s3": {
"access_key": "<TEMP_AWS_ACCESS_KEY_ID>",
"secret": "<TEMP_AWS_SECRET_ACCESS_KEY>",
"session_token": "<TEMP_AWS_SESSION_TOKEN>",
"bucket": "<S3_BUCKET_NAME>",
"region": "<S3_BUCKET_REGION>"
}
}
}'
What each placeholder is and how to obtain it:
• <YOUR_LIVEKIT_HOST>: your LiveKit host domain (self-hosted host like livekit.example.com or LiveKit Cloud domain like your-project.livekit.cloud). Include port if needed.
• <LIVEKIT_ACCESS_TOKEN>: a JWT generated by your server using your API key/secret granting permission to start egress. Generate with LiveKit server SDK (Node/Go). I can provide a snippet if you need one.
• <ROOM_NAME>: room to record (e.g., test-room).
• <PREFIX/playlist.m3u8>: HLS master playlist path/prefix written to S3 (e.g., hls/test-room/playlist.m3u8).
• <TEMP_AWS_ACCESS_KEY_ID>, <TEMP_AWS_SECRET_ACCESS_KEY>, <TEMP_AWS_SESSION_TOKEN>: temporary AWS credentials from STS or an assumed role. Ensure the credentials include s3:PutObject permission and are valid for the recording duration.
• <S3_BUCKET_NAME>, <S3_BUCKET_REGION>: your S3 bucket and region (e.g., my-recordings-bucket, us-west-2).
Anything else I should fill in for you (e.g., token generator snippet in Node/Go or example STS command to get temporary creds)?icy-beard-64788
12/06/2025, 5:55 AMtall-airline-16756
12/06/2025, 5:56 AMicy-beard-64788
12/06/2025, 5:56 AMtall-airline-16756
12/06/2025, 5:56 AMlivkit_url (self‑hosted) or are you using LiveKit Cloud?
2. Which server language/SDK do you want for token generation and starting egress: Node (JavaScript), Go, or another?
3. Which client will you use to join the room for testing: Web, iOS, Android, or the Agents Playground link you shared?
4. Output type: do you want a single MP4 file in S3 or HLS segments/playlist?
5. Do you already have an S3 bucket and temporary AWS creds, or do you want the STS/assume-role steps included?
Pick answers for 1–5 and I’ll produce the complete step-by-step guide and all code/curl commands tailored to your choices.