Troubleshooting of Amazon Rekognition: Difference between revisions
Jump to navigation
Jump to search
m
Troubleshooting of Amazon Rekognition (edit)
Revision as of 18:25, 30 December 2022
, 30 December 2022→Fix the ImageTooLargeException
(Created page with "Troubleshooting of Amazon Rekognition ([https://aws.amazon.com/tw/rekognition/?blog-cards.sort-by=item.additionalFields.createdDate&blog-cards.sort-order=desc Amazon Rekogniti...") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Troubleshooting of Amazon Rekognition ([https://aws.amazon.com/tw/rekognition/?blog-cards.sort-by=item.additionalFields.createdDate&blog-cards.sort-order=desc Amazon Rekognition – 影片與影像 – AWS]) | Troubleshooting of Amazon Rekognition ([https://aws.amazon.com/tw/rekognition/?blog-cards.sort-by=item.additionalFields.createdDate&blog-cards.sort-order=desc Amazon Rekognition – 影片與影像 – AWS]) | ||
The | (The article written in [https://errerrors.blogspot.com/2020/12/troubleshooting-amazon-rekognition-video.html Traditional Chinese]) | ||
== An error occurred (InvalidS3ObjectException) when calling the DetectLabels operation: Unable to get object metadata from S3. Check object key, region and/or access permissions. | == Fix the ImageTooLargeException == | ||
* Error message: An error occurred (ImageTooLargeException) when calling the DetectLabels operation: Image dimensions: null x null pixels exceed the maximum limit.<ref>[https://docs.aws.amazon.com/rekognition/latest/dg/limits.html Guidelines and quotas in Amazon Rekognition - Amazon Rekognition]</ref> | |||
* Condition: The original file was bigger than 5MB or too large: e.g. dimensions of image met trouble is 19842 × 7464 | |||
* Solution: (1) Resize the file size to smaller than 5MB (2) Reduce the dimensions of image to 4096 pixels for both width and height. | |||
* Tools: [https://www.reduceimages.com/ Resize Images Online - Reduce JPG, BMP, GIF, PNG images] | |||
== Fix the InvalidImageFormatException == | |||
* Error message: An error occurred (InvalidImageFormatException) when calling the DetectLabels operation: Request has invalid image format<ref>[https://docs.aws.amazon.com/rekognition/latest/dg/error-handling.html Error handling - Amazon Rekognition]</ref> | |||
* Condition: The original file (PNG file) was a colorful photo | |||
* Solution: Save as JPEG file. | |||
== Fix the InvalidS3ObjectException == | |||
Error message: An error occurred (InvalidS3ObjectException) when calling the DetectLabels operation: Unable to get object metadata from S3. Check object key, region and/or access permissions. | |||
Condition: After input the command as follows: | Condition: After input the command as follows: | ||
Line 14: | Line 26: | ||
Solution: Please verify (1) the name of S3 bucket, (2) name of file path of your file (3) name of region | Solution: Please verify (1) the name of S3 bucket, (2) name of file path of your file (3) name of region | ||
== An error occurred (ValidationException) when calling the StartLabelDetection operation: 2 validation errors detected: Value 'TopicARN' at 'notificationChannel.sNSTopicArn' failed to satisfy constraint: Member must satisfy regular expression pattern: (^arn:([a-z\d-]+):sns:.*:\w{12}:.+$); Value 'RoleARN' at 'notificationChannel.roleArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:([a-z\d-]+):iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+ | == Fix the ValidationException == | ||
Error message: An error occurred (ValidationException) when calling the StartLabelDetection operation: 2 validation errors detected: Value 'TopicARN' at 'notificationChannel.sNSTopicArn' failed to satisfy constraint: Member must satisfy regular expression pattern: (^arn:([a-z\d-]+):sns:.*:\w{12}:.+$); Value 'RoleARN' at 'notificationChannel.roleArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:([a-z\d-]+):iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+ | |||
Condition: After input the command as follows: | Condition: After input the command as follows: | ||
Line 20: | Line 34: | ||
<pre> | <pre> | ||
% aws rekognition start-label-detection --video "S3Object={Bucket=YOUR_BUCKET_NAME,Name=YOUR_VIDEO_FILE}" \ | % aws rekognition start-label-detection --video "S3Object={Bucket=YOUR_BUCKET_NAME,Name=YOUR_VIDEO_FILE}" \ | ||
--notification-channel "SNSTopicArn=TopicARN,RoleArn=RoleARN" \ | |||
--region us-east-1 | --region us-east-1 | ||
</pre> | </pre> | ||
Solution: Please verify | Solution: Please verify the setting of Amazon SNS<ref>[https://docs.aws.amazon.com/rekognition/latest/dg/api-video-roles.html Configuring Amazon Rekognition Video - Amazon Rekognition]</ref> If the amount of videos are not too many, you may remove the options "notification-channel". The command will become: | ||
<pre> | |||
aws rekognition start-label-detection --video "S3Object={Bucket=YOUR_BUCKET_NAME,Name=YOUR_VIDEO_FILE}" --region us-east-1 | |||
</pre> | |||
== Fix the ValidationException - Value 'bocket name' at 'image.s3Object.bucket' failed to satisfy == | |||
* Error message: An error occurred (ValidationException) when calling the DetectLabels operation: 1 validation error detected: Value 'bocket name' at 'image.s3Object.bucket' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9A-Za-z\.\-_]* | |||
* Condition: I did not specify the bucket name in the command | |||
* Solution: Specify the bucket name | |||
== FAILED 2.8 'Unsupported codec/format. == | == FAILED 2.8 'Unsupported codec/format. == | ||
Line 33: | Line 58: | ||
</pre> | </pre> | ||
Solution: Please verify the file format (mp4 or mov) and video encoding of video file: {{kbd | key=H.264}}<ref>[https://wiki.nus.edu.sg/display/LumiNUSstaff/Check+if+my+MP4+video+has+h.264+codec Check if my MP4 video has h.264 codec - LumiNUS Staff Guide - Wiki.nus]</ref> | Solution: Please verify the file format (mp4 or mov) and video encoding of video file: {{kbd | key=H.264}}<ref>[https://docs.aws.amazon.com/rekognition/latest/dg/video.html#video-storage-formats Working with stored videos - Amazon Rekognition]</ref><ref>[https://wiki.nus.edu.sg/display/LumiNUSstaff/Check+if+my+MP4+video+has+h.264+codec Check if my MP4 video has h.264 codec - LumiNUS Staff Guide - Wiki.nus]</ref> | ||
Quoted from [https://aws.amazon.com/rekognition/faqs/?nc1=h_ls#Amazon_Rekognition_Video Amazon Rekognition – frequently asked questions - AWS] | Quoted from [https://aws.amazon.com/rekognition/faqs/?nc1=h_ls#Amazon_Rekognition_Video Amazon Rekognition – frequently asked questions - AWS] | ||
<pre> | <pre> | ||
Q: What types file formats and codecs does Amazon Rekognition Video support? | Q: What types file formats and codecs does Amazon Rekognition Video support? | ||
Amazon Rekognition Video supports H.264 files in MPEG-4 (.mp4) or MOV format. If your video files use a different codec, you can transcode them into H.264 using AWS Elemental MediaConvert. | Amazon Rekognition Video supports H.264 files in MPEG-4 (.mp4) or MOV format. If your video files use a different codec, you can transcode them into H.264 using AWS Elemental MediaConvert. | ||
<pre> | </pre> | ||
== References == | == References == |