helpful-machine-32005
06/25/2025, 1:07 PMasync def entrypoint(ctx: JobContext):
# Add the following code to the top, before calling ctx.connect()
# Set up recording
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>",
),
)],
)
lkapi = api.LiveKitAPI()
res = await lkapi.egress.start_room_composite_egress(req)
await lkapi.aclose()
tall-airline-16756
06/25/2025, 1:07 PMtall-airline-16756
06/25/2025, 1:07 PMfilepath
parameter in the file_outputs
of a RoomCompositeEgressRequest
specifies the path where the recorded file will be stored in your chosen cloud storage provider. For example, in your code snippet, the filepath "livekit/my-room-test.ogg"
indicates the directory path and filename where the recording will be saved within your S3 bucket.
Sources: Session recording and transcripts | LiveKit Docs | GitHub::livekit::livekit_composite | livekit/livekit-cli/cmd/lk/examples/ro...