<@U084APK40NS> i want to get the list of stream ur...
# ask-ai
r
@millions-hair-24956 i want to get the list of stream urls in an egress
g
To get the list of stream URLs in an egress, you can use the
listEgress
method from the LiveKit Egress API. This method allows you to retrieve information about active egress instances, including their stream URLs if they are configured for streaming. Here's a basic example using JavaScript:
Copy code
const egressClient = new EgressClient('https://your-livekit-host', 'livekit-api-key', 'livekit-api-secret');
const egressList = await egressClient.listEgress();
egressList.forEach(egress => {
  if (egress.streamOutputs) {
    console.log(egress.streamOutputs.urls);
  }
});
Would you like more details on how to implement this in a specific programming language or environment? Sources: - EgressClient | LiveKit JS Server SDK 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
r
@millions-hair-24956
Copy code
streamOutputs
is always undefined
g
It seems likely that the
streamOutputs
being undefined could be due to the egress not being configured with stream outputs. When starting an egress, ensure that the
stream_outputs
parameter is set correctly in your egress request. This parameter should include the protocol and URLs for the streams. Here's an example of how to configure stream outputs when starting an egress:
Copy code
const streamOutput = new StreamOutput({
  protocol: 'rtmp',
  urls: ['rtmp://your-rtmp-endpoint/path/stream-key']
});

const egressInfo = await egressClient.startRoomCompositeEgress('your-room-name', {
  stream: streamOutput
});
If
streamOutputs
is still undefined, verify that the egress was started with the correct configuration and that the egress is active. Would you like more detailed troubleshooting steps? Sources: - https://livekit-users.slack.com/archives/C07FVFARRK7/p1728540293.805929 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.