I am using the egress service for exporting the au...
# ask-ai
a
I am using the egress service for exporting the audio to my AWS S3 but I am not seeing the exported audio in my s3 storage. This is the code I am using
Copy code
req = api.RoomCompositeEgressRequest(
        room_name=ctx.room.name,
        audio_only=True,
        file_outputs=[api.EncodedFileOutput(
            file_type=api.EncodedFileType.OGG,
            filepath="my-room-test.ogg",
            s3=api.S3Upload(
                bucket=os.getenv("AWS_BUCKET_NAME"),
                region=os.getenv("AWS_REGION"),
                access_key=os.getenv("AWS_ACCESS_KEY"),
                secret=os.getenv("AWS_SECRET"),
            ),
        )],
    )

    lkapi = api.LiveKitAPI()
    res = await lkapi.egress.start_room_composite_egress(req)
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you get this audio export issue to AWS S3 sorted out! To better understand what's going on, could you please share a few details with me? • What’s the egress status when the problem happens? For example, do you see EGRESS_FAILED or EGRESS_COMPLETE? • Are there any error messages or logs from the egress service that you’ve noticed? • Are you using IAM roles or access keys for your S3 authentication? • Do you have a backup storage set up, and if so, are the files showing up there? • Have you checked that your S3 credentials have the right permissions, like s3:PutObject? Thanks so much for providing these details—this will really help us get to the bottom of things together! Sources: pkg/config/base.go | Universal Egress | cmd/lk/examples/auto-track-egress.json | livekit-protocol/livekit/protocol/egress.pyi | Egress output types | LiveKit Docs
a
There is no logs in the output. How can I check the logs for the egress?
t
I'd be happy to help you check the logs for the egress service! Depending on how your system is set up, here’s what you can do: • For Docker: You can simply run
docker logs <container-name>
to see the logs from your egress container. • For Kubernetes: Try
kubectl logs <pod-name>
to access the logs from your egress pod. • For Systemd Services: Use
journalctl -u <service-name>
to view the logs related to the egress service. • For LiveKit Cloud: You can check the logs right from the LiveKit Cloud dashboard. If you’re running a self-hosted deployment, just make sure the
log_level
in your egress configuration file is set to
info
or `debug`—this will help capture more detailed logs. Please feel free to reach out if you’d like any help with accessing or understanding these logs—I’m here to support you! Sources: pkg/service/egress.go | pkg/service/process.go | examples/egress.yaml | cmd/lk/egress.go | Create and configure a Plivo SIP trunk | LiveKit Docs
a
there is no result of egress. How can I configure an egress to save the audio?
t
To help you configure LiveKit egress to save audio to AWS S3, here’s a simple step-by-step guide you can follow: 1. Set up S3 Configuration: First, make sure your AWS S3 bucket is created and accessible. Also, have your credentials ready—this includes your access key, secret key, and region. 2. Global Configuration: Next, add your S3 details to the egress service configuration file. Here’s an example to guide you:
Copy code
storage:
  s3:
    access_key: your-aws-access-key
    secret: your-aws-secret-key
    region: us-east-1
    bucket: your-egress-bucket
1. Per-Request Configuration: If you want to specify S3 settings for individual egress requests, just include the S3 details right in the request payload. Something like this works well:
Copy code
file_outputs=[api.EncodedFileOutput(
    file_type=api.EncodedFileType.OGG,
    filepath="my-room-test.ogg",
    s3=api.S3Upload(
        bucket="your-bucket",
        region="us-east-1",
        access_key="your-access-key",
        secret="your-secret-key",
    ),
)]
1. Verify Permissions: It’s important to check that your S3 credentials have the right permissions, especially
s3:PutObject
, so files can be uploaded smoothly to your bucket. 2. Test the Configuration: Finally, start an egress session and keep an eye on the egress status to make sure your audio is being saved to S3 as expected. If you run into any bumps along the way or want me to walk you through any of these steps in more detail, please don’t hesitate to reach out—I’m here to help! Sources: Universal Egress | cmd/lk/examples/web-egress.json | Egress API | LiveKit Docs | README.md | deploy-egress.sh