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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠