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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ