clever-doctor-15083
02/14/2025, 9:29 AMgray-monkey-83525
02/14/2025, 9:29 AMcalm-optician-60209
02/14/2025, 12:20 PMgray-monkey-83525
02/14/2025, 12:20 PMcalm-optician-60209
02/14/2025, 12:21 PMgray-monkey-83525
02/14/2025, 12:21 PMcalm-optician-60209
02/14/2025, 8:37 PMgray-monkey-83525
02/14/2025, 8:37 PMcalm-optician-60209
02/14/2025, 8:39 PMgray-monkey-83525
02/14/2025, 8:39 PMcalm-optician-60209
02/14/2025, 9:12 PMgray-monkey-83525
02/14/2025, 9:12 PMimport { EgressClient, EncodedFileOutput } from "livekit-server-sdk";
const egressClient = new EgressClient('https://your-livekit-host', 'livekit-api-key', 'livekit-api-secret');
const fileOutput = new EncodedFileOutput({
filepath: 'your-room-name/recording.mp4',
azure: {
account_name: 'your-azure-account-name',
account_key: 'your-azure-account-key',
container_name: 'your-container-name',
},
});
const info = await egressClient.startRoomCompositeEgress('your-room-name', {
file: fileOutput,
}, {
layout: 'grid', // or any other layout you prefer
});
console.log('Egress started with ID:', info.egressId);
This code sets up a RoomComposite Egress to record a session and save it to Azure Blob Storage. Make sure to replace placeholders like 'your-livekit-host'
, 'your-azure-account-name'
, and others with your actual configuration details.
Would you like more details on any specific part of this setup?
Sources:
- RoomComposite Egress 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.calm-optician-60209
02/14/2025, 9:12 PMgray-monkey-83525
02/14/2025, 9:12 PMfrom livekit import api
# Initialize the LiveKit API client
lkapi = api.LiveKitAPI('https://your-livekit-host', 'livekit-api-key', 'livekit-api-secret')
# Configure the file output for Azure Blob Storage
file_output = api.EncodedFileOutput(
filepath='your-room-name/recording.mp4',
azure=api.AzureBlobUpload(
account_name='your-azure-account-name',
account_key='your-azure-account-key',
container_name='your-container-name',
)
)
# Start RoomComposite Egress
egress_info = await lkapi.egress.start_room_composite_egress(
api.RoomCompositeEgressRequest(
room_name='your-room-name',
file=file_output,
layout='grid' # or any other layout you prefer
)
)
print(f'Egress started with ID: {egress_info.egress_id}')
Replace placeholders like 'your-livekit-host'
, 'your-azure-account-name'
, and others with your actual configuration details.
Would you like more details on any specific part of this setup?
Sources:
- https://livekit-users.slack.com/archives/C07FVFARRK7/p1730759958.958929
- https://livekit-users.slack.com/archives/C07FY8WHGPM/p1727992834.783299 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.