How can I get the call recording duration by using...
# ask-ai
b
How can I get the call recording duration by using egress_id
t
Thanks for reaching out, Ambuj. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you find the call recording duration using the egress_id. You can do this by calling the
ListEgress
API method, which will give you an
EgressInfo
object with these helpful fields: • `started_at`: This is the Unix timestamp (in nanoseconds) marking when the egress started. • `ended_at`: This shows the Unix timestamp (in nanoseconds) for when the egress ended. To figure out the duration, you can follow these simple steps: 1. First, grab the
started_at
and
ended_at
values from the API response. 2. Then, calculate the duration by using this formula:
(ended_at - started_at) / 1,000,000,000
— this converts the time from nanoseconds to seconds. If you’d like, I’m here to walk you through the API or provide some examples. Just let me know how I can assist! Sources: livekit-protocol/livekit/protocol/egress.pyi | cmd/lk/egress.go