flaky-beard-91685
08/22/2025, 6:21 AMtall-airline-16756
08/22/2025, 6:21 AMtall-airline-16756
08/22/2025, 6:23 AMoutput field in your recording request is either missing or has some incorrect data. No worries though, here’s how you can fix it:
• If you’re working with a TrackEgressRequest, just make sure the output field is set to a valid DirectFileOutput object or a proper websocket_url.
• For other egress types like RoomCompositeEgressRequest, WebEgressRequest, or TrackCompositeEgressRequest, try to avoid using the old output field. Instead, set up the right fields like file_outputs, stream_outputs, segment_outputs, or image_outputs with valid details.
If you want, I’m here to help you sort out these settings—just let me know!
Sources: pkg/errors/errors.go | protobufs/livekit_egress.proto | RoomComposite Egress | LiveKit Docs | packages/livekit-server-sdk/src/EgressClient.tsflaky-beard-91685
08/22/2025, 6:26 AMtall-airline-16756
08/22/2025, 6:27 AMEncodedOutput for video stream recording in LiveKit:
1. Set Up Your Output Configuration: Start by using EncodedFileOutput to specify:
◦ `file_type`: Pick either MP4 or OGG format, whichever suits you best.
◦ `filepath`: Decide where you want to save your file, like {room_name}-{time}.mp4.
◦ Cloud storage info: Don’t forget to add your credentials and bucket details if you’re using S3, GCP, Azure, or AliOSS.
1. Kick Off the Egress Request: Use gRPC methods such as StartRoomCompositeEgress, StartParticipantEgress, or StartTrackCompositeEgress. These take file_outputs as a repeated field of EncodedFileOutput.
2. Here’s a quick example using the JavaScript SDK:
const fileOutput = new livekit.EncodedFileOutput({
filepath: 'recordings/{room_name}-{time}.mp4',
fileType: livekit.EncodedFileType.MP4,
s3: new livekit.S3Upload({
accessKey: 'your-key',
secret: 'your-secret',
region: 'us-west-2',
bucket: 'your-bucket',
}),
});
await egressClient.startRoomCompositeEgress(
'my-room',
{ file: fileOutput },
{ layout: 'grid', videoOnly: false }
);
This snippet records your room and saves the video as an MP4 file right in your S3 bucket.
If you have any questions or want a hand with setup, just let me know—I’m here to help!
Sources: egress/types.go | Egress API | LiveKit Docs | packages/livekit-server-sdk/src/EgressClient.ts | Egress API | LiveKit Docs