Wrong error message when using get_images() in KinesisVideoArchivedMedia Client

0

Hello, I keep getting a consistent response when calling in the following syntax:

response = client.get_images(
    StreamARN='StramARN',
    ImageSelectorType='PRODUCER_TIMESTAMP',
    StartTimestamp=datetime(year,month,day),
    EndTimestamp=datetime(year,month,day),
    SamplingInterval=3000,
    Format='JPEG',
    MaxResults=50
)

And a response in this format:

{'ResponseMetadata': {'RequestId': 'someID',
  'HTTPStatusCode': 200,
  'HTTPHeaders': {'x-amzn-requestid': 'someID',
   'content-type': 'application/json',
   'content-length': '90',
   'date': 'Wed, 15 Jun 2022 08:09:58 GMT'},
  'RetryAttempts': 0}}

According to the documentation, the response syntax should be something like:

{
    'Images': [
        {
            'TimeStamp': datetime(2015, 1, 1),
            'Error': 'NO_MEDIA'|'MEDIA_ERROR',
            'ImageContent': 'string'
        },
    ],
    'NextToken': 'string'
}

I have altered the ImageSelectorType to random strings but still got the same response. Any idea why would that be the issue? I am trying to get images inside AWS SageMaker Studio

3 回答
0

Hello, This is Jorge and It looks like you are trying understand the reason why you are not getting the correct output from your request. I do recommend you to check the AWS SDK (It seems you are using Java SDK, feel free to confirm that) version you are using and to make sure you are importing the correct Libraries. https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoArchivedMediaClient.java

I also encourage you for creating an issue under the GitHub page -> Tab Issues with your error message; https://github.com/aws/aws-sdk-java/issues

Looking forward for your feedback.

AWS
已回答 2 年前
  • Hi Jorge, many thanks for your reply. Apologies but I should've mentioned that I am using AWS Python SDK (Boto3) latest version

0

Even though the error is misleading, you can solve this by calling the correct endpoint:

client_end = boto3.client('kinesisvideo')
response_end = client_end.get_data_endpoint(
    StreamARN=ARN,
    APIName='GET_IMAGES'
)
endpoint = response_end['DataEndpoint']
client = boto3.client('kinesis-video-archived-media', endpoint_url=endpoint)
已回答 2 年前
0

There are two parts to the response. Please print / save the 'Images' response to get Image details / Image Error details.

resp = kvs_archived_media_client.get_images(StreamName=stream_name,
                                        ImageSelectorType='PRODUCER_TIMESTAMP',
                                        StartTimestamp=start_timestamp,
                                        EndTimestamp=end_timestamp,
                                        SamplingInterval=3000,
                                        Format='JPEG')
images = resp['Images']
metadata = resp['ResponseMetadata']
AWS
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容