What is the complete process of exporting room com...
# ask-ai
a
What is the complete process of exporting room composite RTMP flow using egress
g
To export a room composite to RTMP using LiveKit's egress service, you need to follow these steps: 1. Initialize Egress Client: Set up an
EgressClient
with your LiveKit host, API key, and secret. 2. Configure Stream Output: Create a
StreamOutput
object specifying the RTMP protocol and the target URLs for streaming. 3. Start RoomComposite Egress: Use the
startRoomCompositeEgress
method, providing the room name, stream output configuration, and layout options. Here's a basic example in JavaScript:
Copy code
const egressClient = new EgressClient('https://my-livekit-host', 'livekit-api-key', 'livekit-api-secret');
const streamOutput = new StreamOutput({
  protocol: StreamProtocol.RTMP,
  urls: ['rtmp://youtube-url/stream', 'rtmps://twitch-url/path'],
});
const info = await egressClient.startRoomCompositeEgress('my-room', { stream: streamOutput }, { layout: 'grid' });
Would you like more details on any specific part of the process? Sources: - RoomComposite Egress - Egress API 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.