"request has missing or invalid field: output" is ...
# ask-ai
f
"request has missing or invalid field: output" is continously shown by LiveKit when starting to record a session.
t
Thanks for reaching out, Ayush. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! That error message, "request has missing or invalid field: output," pops up when the
output
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.ts
f
I want to use EncodedOutput for video stream recording, how should I implement it?
t
Here’s a friendly guide to using
EncodedOutput
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:
Copy code
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