Amazon rekognition segmentaion response

0

I have requested for a video segmentation using rekognition tool. The documentation says that the output of the "sqs.receive_message" should be like this:

Response Syntax { 'Messages': [ { 'MessageId': 'string', 'ReceiptHandle': 'string', 'MD5OfBody': 'string', 'Body': 'string', 'Attributes': { 'string': 'string' }, 'MD5OfMessageAttributes': 'string', 'MessageAttributes': { 'string': { 'StringValue': 'string', 'BinaryValue': b'bytes', 'StringListValues': [ 'string', ], 'BinaryListValues': [ b'bytes', ], 'DataType': 'string' } } }, ] }

But I don't receive such a response. Here is what I always get:

{'ResponseMetadata': {'RequestId': 'xxxxxx', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'xxxxxx', 'date': 'Thu, 27 Jan 2022 11:32:58 GMT', 'content-type': 'text/xml', 'content-length': '240'}, 'RetryAttempts': 0}}

Any idea where the problem is?

asked 2 years ago191 views
1 Answer
0

Hi,

Thank you for using Rekognition Video.

Please follow this example to retrieve SQS message body - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs.html#processing-messages

If you are trying to receive video segmentation job completion notification through SNS+SQS, please follow this documentation for configuring role/permissions - https://docs.aws.amazon.com/rekognition/latest/dg/api-video-roles.html.

The resulted SQS message body (from Rekognition Video) will look like:

{
  "Type" : "Notification",
  "MessageId" : "abcd-efgh-ijkl-mnop",
  "TopicArn" : "arn:aws:sns:us-east-1:123456789012:testsns",
  "Message" : "{\"JobId\":\"asdfghjklzxcvbnmpoiuytrewq1234567890\",\"Status\":\"SUCCEEDED\",\"API\":\"StartLabelDetection\",\"Timestamp\":1649971127542,\"Video\":{\"S3ObjectName\":\"a.mp4\",\"S3Bucket\":\"testbucket\"}}",
  "Timestamp" : "2022-04-14T21:18:47.648Z",
  "SignatureVersion" : "1",
  "Signature" : "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-1234567890poiuytrewq.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:123456789012:testsns:abcd-efgh-ijkl-mnop"
}
AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions