recording_req = api.RoomCompositeEgressRequest( ...
# ask-ai
c
recording_req = api.RoomCompositeEgressRequest( room_name=ctx.room.name, audio_only=True, file_outputs=[file_output], # New field file=file_output, # Deprecated field for compatibility )
t
Thanks for reaching out, raj. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just a quick tip on using `RoomCompositeEgressRequest`: it’s best to set up the
file_outputs
field with one or more
EncodedFileOutput
objects. The older
file
field is deprecated now, so it’s a good idea to steer clear of it. Here’s a simple example to show you how
file_outputs
works:
Copy code
req = api.RoomCompositeEgressRequest(
    room_name=ctx.room.name,
    audio_only=True,
    file_outputs=[api.EncodedFileOutput(
        file_type=api.EncodedFileType.OGG,
        filepath="livekit/my-room-test.ogg",
        s3=api.S3Upload(
            bucket="<s3 bucket name>",
            region="<s3 region>",
            access_key="<s3 access key>",
            secret="<s3 secret key>",
        ),
    )],
)
In this example, we’re recording audio in OGG format straight to an S3 bucket. If you want, you can even add multiple
EncodedFileOutput
objects to the
file_outputs
list to save recordings to several places at once. Pretty handy, right? Sources: protobufs/livekit_egress.proto | Session recording and transcripts | LiveKit Docs
c
Problem: We're using the correct file_outputs=[file_output] field as recommended, but the Egress service still returns: text TwirpError(code=invalid_argument, message=request has missing or invalid field: output, status=400) What we've tried: 1. ✅ file_outputs=[file_output] only (as per your recommendation) 2. ✅ file_outputs=[file_output] + file=file_output (backward compatibility) 3. ✅ output=file_output (caused ValueError) Current state: Using only file_outputs=[file_output] as you suggested, but still getting the "missing output field" error. Questions: 1. Why is the Egress service still expecting an output field when we're using the correct file_outputs field? 2. Is there a version mismatch between our Python SDK and Egress service that's causing this? 3. Are there additional required fields we're missing in the RoomCompositeEgressRequest? 4. Should we be using a different API method entirely for local file recording? Environment: • Python SDK: Latest version • Egress service: Running via Docker Compose • Recording target: Local file system (not S3) The agent is working perfectly otherwise - all database tables populated, lead status updates correctly, conversation flow works. Only the audio recording is failing due to this persistent API field issue. TwirpError(code=invalid_argument, message=request has missing or invalid field: output, status=400)
t
To get this sorted out together, could you please check a few things for me? • Are you filling in the
filepath
field in the
EncodedFileOutput
object, and is that path valid on your local system? • Have you set up the
local_file
field in the
EncodedFileOutput
object for recording files locally? • Also, could you share the exact versions of the Python SDK and Egress service you’re using? That can really help us spot any version mismatches. With these details, we’ll be in a better spot to figure out what’s causing the "missing or invalid field: output" error. Thanks for your help!
c
Problem: We're using the correct file_outputs=[file_output] field as recommended, but the Egress service still returns: text TwirpError(code=invalid_argument, message=request has missing or invalid field: output, status=400) Current Setup: 1. Python SDK Version: livekit==1.0.12 2. Egress Service Version: livekit/egress:latest (Docker image) 3. File Output Configuration: 4. python 5. 6. 7. 8. file_output = api.EncodedFileOutput( 9. _file_type_=api.EncodedFileType.MP4, # MP4 format 10. filepath="recordings/outbound-call-XXXXX_20250826_164416.mp4", # Local file path 11. ) 12. 13. 14. Recording Request: 15. python 16. 17. 18. 19. recording_req = api.RoomCompositeEgressRequest( 20. _room_name_=ctx.room.name, 21. _audio_only_=True, 22. _file_outputs_=[file_output], _# Using only file_outputs as recommended_ 23. ) 24. 25. 26. Local File Setup: • ✅ filepath field is filled with valid local path • ✅ Local recordings directory is mounted: ./recordings:/out/livekit/calls • ❌ Missing: We're NOT setting the local_file field in EncodedFileOutput Questions for LiveKit Bot: 1. Do we need to set local_file=True in the EncodedFileOutput object for local file recording? 2. Is there a version compatibility issue between Python SDK 1.0.12 and the latest Egress service? 3. Are we missing required fields for local file recording that aren't needed for cloud storage? 4. Should the filepath be relative to the Egress container (/out/livekit/calls/...) or absolute? The key insight is that we're trying to record to local files but may be missing the local_file configuration that tells the Egress service this is a local recording, not cloud storage.
t
Hey there! Just to clarify, local file recording isn’t something the current LiveKit Egress service supports out of the box. The
EncodedFileOutput
setup is actually meant for cloud storage options like S3, GCP, Azure, or AliOSS. When you see the
filepath
field, it’s referring to the file name in the cloud storage, not a path on your local machine. Let me break down your questions: 1. Do we need to set
local_file=True
in the
EncodedFileOutput
object?
Actually, there’s no
local_file
option in
EncodedFileOutput
. Since local file recording isn’t supported, you don’t need to worry about this. 2. Is there a version compatibility issue between Python SDK 1.0.12 and the latest Egress service? From what I can see, there’s no version mismatch causing this problem. The error probably comes from trying to use local file recording, which isn’t supported. 3. Are we missing required fields for local file recording that aren't needed for cloud storage? Since local file recording isn’t supported, your configuration should focus on cloud storage settings instead. 4. Should the
filepath
be relative to the Egress container or absolute?
The
filepath
is just the name of the file in your cloud storage—it doesn’t relate to any local file system paths. So, to move forward, you’ll want to set up your recordings to go to a supported cloud storage destination. If you’d like, I’m happy to help guide you through setting that up! Sources: egress/types_test.go | RoomComposite Egress | LiveKit Docs
c
so do i need to still run a local docker container for egress service here then\
t
Yes, you’ll still need to run the Egress service as a local Docker container. It’s the part that takes care of recording and then uploads everything to your chosen cloud storage. Although recording directly to local files isn’t an option, the Egress service is key for managing both the recording and the upload to the cloud. If you’d like a hand setting up the Egress service or configuring your cloud storage, just let me know—I’m here to help you through it!