narrow-hairdresser-82835
10/21/2025, 12:16 PMtall-airline-16756
10/21/2025, 12:16 PMtall-airline-16756
10/21/2025, 12:17 PMegress field in the CreateRoom API. This way, you can choose to automatically record the room as a composite or capture each published track separately.
If you’d like, I’m here to walk you through the details or answer any questions you might have!
Sources: Auto egress | LiveKit Docs | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | How to enable auto-egress with SIP | rpc/egress.pb.gonarrow-hairdresser-82835
10/21/2025, 12:18 PMtall-airline-16756
10/21/2025, 12:20 PMCreateRoom API. Here's a friendly example to guide you through it:
import { RoomServiceClient } from 'livekit-server-sdk';
const roomService = new RoomServiceClient(
<BASE_API_URL>,
'your-api-key',
'your-api-secret'
);
// Complete auto egress configuration
await roomService.createRoom({
name: 'my-room',
egress: {
// Room composite recording - records entire room
room: {
fileOutputs: [{
fileType: 'MP4',
filepath: '/recordings/room-{room_name}-{time}.mp4'
}],
streamOutputs: [{
protocol: 'RTMP',
urls: ['rtmp://your-streaming-server/live/stream-key']
}]
},
// Auto track recording - records each published track
tracks: {
fileOutputs: [{
fileType: 'MP4',
filepath: '/recordings/tracks/{room_name}/{track_id}-{time}.mp4'
}]
},
// Auto participant recording - records each participant
participant: {
fileOutputs: [{
fileType: 'MP4',
filepath: '/recordings/participants/{room_name}/{participant_identity}-{time}.mp4'
}]
}
}
});
This example covers how to set up auto egress for room composite recording, auto track recording, and auto participant recording. If anything feels unclear or if you'd like me to walk you through more examples, please don't hesitate to ask—I'm here to help!
Sources: livekit/livekit_room.pb.go | packages/livekit-server-sdk/src/RoomServiceClient.ts | livekit-protocol/src/livekit.rs | lib/livekit/room_service_client.rb | livekit-protocol/livekit/protocol/room.pyinarrow-hairdresser-82835
10/21/2025, 12:21 PMtall-airline-16756
10/21/2025, 12:22 PMRoomConfiguration along with the with_room_config method. The RoomConfiguration object has an egress field where you can set up auto-egress options. These settings will take effect as soon as the room is created.
Here’s a friendly example in Python:
token = (
api.AccessToken()
.with_identity("my_participant")
.with_grants(api.VideoGrants(room_join=True, room=room_name))
.with_room_config(
api.RoomConfiguration(
agents=[api.RoomAgentDispatch(agent_name="test-agent", metadata="my_metadata")],
egress=api.RoomEgress(
room=api.RoomCompositeEgressRequest(
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath="/recordings/room-{room_name}-{time}.mp4"
)
]
)
)
)
)
.to_jwt()
)
This way, you can seamlessly include egress settings right in the token, making it easy to start recording or streaming automatically when the room begins. If you’d like, I’m here to help with more details or other examples—just let me know!
Sources: SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | livekit-protocol/src/livekit.rs | src/test/kotlin/io/livekit/server/AccessTokenTest.kt | examples/agent_dispatch.py