How to access prefix S3 while auto record with Amazon IVS?

495 Views Asked by At

Today I tried to use Amazon Interactive Video Service with auto record to an Amazon S3 bucket. The problem is that after live streaming ended I want to get the video recorded in S3. I follow the documentation then I get path/prefix like below:

/ivs/v1/<aws_account_id>/<channel_id>/<year>/<month>/<day>/<hours>/<minutes>/<recording_id>

At the path I can find in response json except

<recording_id>

FYI the recording_id created when I start live streaming, but I cannot get a response. So how can I get the recording id with response JSON to access the path of video recorded in S3?

1

There are 1 best solutions below

0
On

According to the AWS IVS documentation, you'll have to subscribe to the IVS Record State Change event. (see link)

In the event data, there's a key called recording_s3_key_prefix that will be in the following format:

"recording_s3_key_prefix": "ivs/v1/123456789012/AbCdef1G2hij/2020/6/23/20/12/j8Z9O91ndcVs"

You'll be able to get the full path from there or if you just want the recording_id you may extract it from this key as well.