calm-jackal-66534
08/21/2025, 4:46 AMtall-airline-16756
08/21/2025, 4:46 AMtall-airline-16756
08/21/2025, 4:47 AMegress_ended webhook event—that’s your signal that the egress process has finished (or if something went wrong). This is the most dependable way to know all your uploads are good to go.
• EgressInfo API Polling: You can also use the ListEgress or StopEgress API to grab the EgressInfo object. Then, check the status field—when it reads EGRESS_COMPLETE (for files) or FINISHED (for stream segments), you’re all set and uploads are complete.
Oh, and one more thing—LiveKit wraps up all uploads by creating a manifest file, which gets uploaded last after all your media files have made it safely to S3.
Sources: Quotas and limits | LiveKit Docs | lib/livekit/proto/livekit_egress_pb.rb | pkg/pipeline/sink/image.gocalm-jackal-66534
08/21/2025, 4:48 AMtall-airline-16756
08/21/2025, 4:49 AMdisableManifest=true in your LiveKit egress configurations means the system won’t upload a JSON manifest file that holds metadata about your output. Here’s how that plays out for different output types:
• For EncodedFileOutput, DirectFileOutput, and AutoTrackEgress, the manifest file (like {filepath}.json) simply won’t be created or uploaded.
• For ImageOutput, the manifest file that lists exported snapshot filenames won’t be created or uploaded either.
• For SegmentedFileOutput (think HLS), the manifest file (the m3u8 playlist) won’t be uploaded.
By default, disableManifest is set to false. So, if you depend on that manifest file to make sure all your uploads are wrapped up, it’s best to keep disableManifest=true off.
Sources: Egress API | LiveKit Docs | auth/accesstoken_test.gocalm-jackal-66534
08/21/2025, 8:32 AMtall-airline-16756
08/21/2025, 8:33 AMwebhook:
api_key: 'api-key-to-sign-with'
urls:
- <YOUR_WEBHOOK_URL>
• Per-Request Webhooks: You can also specify extra webhooks right in your egress request using the webhooks field.
Example Webhook Payload
When an egress finishes, you’ll get a payload like this:
{
"event": "egress_ended",
"room": {
"sid": "RM_abc123",
"name": "my-room"
},
"egressInfo": {
"egressId": "EG_xyz789",
"roomId": "RM_abc123",
"roomName": "my-room",
"status": "EGRESS_COMPLETE",
"startedAt": 1640995200000,
"endedAt": 1640995800000,
"fileResults": [
{
"filename": "my-room-20220101T120000.mp4",
"location": "s3://my-bucket/recordings/my-room-20220101T120000.mp4",
"size": 52428800,
"duration": 600000
}
]
}
}
Webhook Handler Example
Here’s a simple Node.js example to help you handle those webhooks:
const lksdk = require('livekit-server-sdk');
const http = require('http');
const receiver = new lksdk.WebhookReceiver(
process.env.LIVEKIT_API_KEY,
process.env.LIVEKIT_API_SECRET
);
const webhookHandler = (req, res) => {
let data = '';
req.on('data', chunk => {
data += chunk;
});
req.on('end', () => {
const event = receiver.receive(data, req.headers.authorization);
console.log('received webhook event', event);
// Handle different egress events
switch(event.event) {
case 'egress_started':
console.log('Egress started:', event.egressInfo);
break;
case 'egress_updated':
console.log('Egress updated:', event.egressInfo);
break;
case 'egress_ended':
console.log('Egress ended:', event.egressInfo);
break;
}
res.writeHead(200);
res.end();
});
}
const server = http.createServer(webhookHandler);
server.listen(3000, () => {
console.log('Webhook server running on port 3000');
});
If you have any questions or want a hand with setting up or handling your webhooks, just let me know—I’m here to help!
Sources: livekit-protocol/livekit/protocol/egress.py | examples/webhooks-http/README.md | Egress & Storage | livekit/livekit_composite | DeepWiki | Webhooks | LiveKit Docs