egress works in console mode?
# ask-ai
b
egress works in console mode?
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m following up about your question: “egress works in console mode?” Could you clarify what you mean by “console mode”? A couple common possibilities: • Do you mean running egress from a terminal/CLI (starting a recording/stream via a command or script)? • Do you mean using the LiveKit web console (dashboard) to start egress? • Or do you mean running LiveKit or the egress service in a non-GUI/container/headless environment? Also, which egress type are you asking about (recording to file, livestream to RTMP, or track/raw data export)? With that I can give a precise answer and steps.
b
there is different types of run for workers: console, dev, start
t
You're asking whether egress works when a worker/agent is run in
console
mode — yes. • The run modes
console
,
dev
, and
start
control how an Agent is executed and connected to LiveKit: ◦
console
runs the agent locally in your terminal (Python only) and connects to an in-process RoomService. ◦
dev
runs the agent for development, connecting to a remote LiveKit server. ◦
start
runs the agent for production use. • Egress is a separate service that records/streams media. Egress requests are processed by the Egress service, not by the agent runtime. You can initiate egress from an agent running in any of those modes (including
console
) as long as: ◦ the agent has the necessary permissions to call the Egress API, and ◦ the agent has network access to reach the Egress service. If you’d like, tell me which egress type you plan to start (file recording, room composite, RTMP livestream, or raw track export) and the language you’re using — I can show the exact request example and any network/permission checks to verify. Sources: Voice AI quickstart | LiveKit docs | Recording and export | LiveKit docs | Observability data hooks | LiveKit docs | Egress API | LiveKit docs
b
i though that console mode don't create a room, so egress can't record it
t
You're right to question that — good catch. Console mode runs the agent locally and connects to an in-process RoomService, but it still creates and manages a real Room instance that behaves like other rooms. Egress is a separate service and can record that Room the same way it records rooms created by agents in
dev
or
start
mode. Key points: •
console
mode does create a Room via the in-process RoomService. • Egress operates independently and can record/stream that Room as long as the agent can call the Egress API and has network access and permissions. • If your console-run agent is isolated (no network access or missing permissions), egress requests will fail — otherwise recording works normally. Do you want an example request for starting a room composite or file egress from a console-mode agent, or help verifying permissions/network reachability?
b
yes
t
Below is a concise Python example showing how an agent running in console mode can start a room composite egress. It also lists the permission and network checks you should verify. 1) Example — start a room composite egress from a console-mode agent
Copy code
# example assumes you have an agent context `ctx` and a LiveKit API client `lkapi`
from livekit import RoomCompositeEgressRequest, FileOutput

req = RoomCompositeEgressRequest(
    room_name=ctx.room.name,
    audio_only=False,
    video_layout="grid",  # optional
    file_outputs=[FileOutput(file_path="/tmp/room_composite.mp4")]
)

# start egress (async)
resp = await lkapi.egress.start_room_composite_egress(req)
print("egress started:", resp.egress_id)
2) Permissions to verify • The agent’s API key/credentials allow calling the Egress API (ability to create egress jobs). • Any IAM or role bindings required by your LiveKit deployment include egress permissions. 3) Network/access checks • The console-mode agent must be able to reach the Egress service endpoint (outbound network access). • If Egress runs as a separate service (self-hosted), ensure service discovery or the configured Egress URL is reachable from your machine. • If writing to external stores (S3, RTMP targets, etc.), verify the agent or Egress service has network access and credentials to those targets. If you tell me which egress type you want (file, room composite, RTMP livestream, or track/raw export) and whether your deployment is LiveKit Cloud or self-hosted, I’ll provide a tailored example and the exact checks to run.