python-sdks icon indicating copy to clipboard operation
python-sdks copied to clipboard

api.LiveKitAPI().start_room_composite_egress(req) failing silently when called from agent

Open jaylim95 opened this issue 11 months ago • 1 comments

from livekit import api

Hey, noticed that await api.LiveKitAPI().start_room_composite_egress(req) would fail silently when called in livekit agent when credentials are misconfigured. Is this expected? Shouldnt it throw an error?

I was following this guide from https://docs.livekit.io/deploy/observability/data/#record-audio-or-video

Expected: throw an error when ccredentials are incorrect Observed: no error is raised

Code:

file_outputs = [
      api.EncodedFileOutput(
          file_type=api.EncodedFileType.OGG,
          filepath=filepath,
          azure=api.AzureBlobUpload(
              account_name=account_name,
              account_key=account_key,
              container_name=container_name,
          ),
      )
  ]
req = api.RoomCompositeEgressRequest(room_name=ctx.room.name, audio_only=True, file_outputs=file_outputs, audio_mixing="DUAL_CHANNEL_AGENT")
lkapi = api.LiveKitAPI()
try:
    await lkapi.egress.start_room_composite_egress(req)
except Exception as e:
    print(e)

On livekit cloud, I can see that egress failed

Image

jaylim95 avatar Dec 21 '25 16:12 jaylim95

Try:

  • audio_mixing=1, or
  • audio_mixing=AudioMixing.DUAL_CHANNEL_AGENT,

Instead of:

  • audio_mixing="DUAL_CHANNEL_AGENT"

But, I do not think it has been implemented: https://github.com/livekit/agents/issues/2365

sperdices avatar Jan 07 '26 02:01 sperdices