create_stream_processor
¶
create_stream_processor(
input: StreamProcessorInput,
output: StreamProcessorOutput,
name: StreamProcessorName,
settings: StreamProcessorSettings,
role_arn: RoleArn,
*,
config_overrides: Optional[RekognitionClientConfig] = None,
tags: Optional[TagMap] = None,
notification_channel: Optional[StreamProcessorNotificationChannel] = None,
kms_key_id: Optional[KmsKeyId] = None,
regions_of_interest: Optional[RegionsOfInterest] = None,
data_sharing_preference: Optional[StreamProcessorDataSharingPreference] = None,
) -> CreateStreamProcessorResponse
Service availability notice: Streaming Video and Bulk Image Analysis is no longer available to new customers. For more information, see Rekognition feature availability changes. This change does not impact the availability of other Amazon Rekognition features.
Creates an Amazon Rekognition stream processor that you can use to detect and recognize faces or to detect labels in a streaming video.
Amazon Rekognition Video is a consumer of live video from Amazon Kinesis Video Streams. There are two different settings for stream processors in Amazon Rekognition: detecting faces and detecting labels.
-
If you are creating a stream processor for detecting faces, you provide as input a Kinesis video stream (
Input) and a Kinesis data stream (Output) stream for receiving the output. You must use theFaceSearchoption inSettings, specifying the collection that contains the faces you want to recognize. After you have finished analyzing a streaming video, use StopStreamProcessor to stop processing. -
If you are creating a stream processor to detect labels, you provide as input a Kinesis video stream (
Input), Amazon S3 bucket information (Output), and an Amazon SNS topic ARN (NotificationChannel). You can also provide a KMS key ID to encrypt the data sent to your Amazon S3 bucket. You specify what you want to detect by using theConnectedHomeoption in settings, and selecting one of the following:PERSON,PET,PACKAGE,ALLYou can also specify where in the frame you want Amazon Rekognition to monitor withRegionsOfInterest. When you run the StartStreamProcessor operation on a label detection stream processor, you input start and stop information to determine the length of the processing time.
Use Name to assign an identifier for the stream processor. You use Name to manage the stream processor. For example, you can start processing the source video by calling StartStreamProcessor with the Name field.
This operation requires permissions to perform the rekognition:CreateStreamProcessor action. If you want to tag your stream processor, you also require permission to perform the rekognition:TagResource operation.
Parameters:
-
input(StreamProcessorInput) –Kinesis video stream stream that provides the source streaming video. If you are using the AWS CLI, the parameter name is
StreamProcessorInput. This is required for both face search and label detection stream processors. -
output(StreamProcessorOutput) –Kinesis data stream stream or Amazon S3 bucket location to which Amazon Rekognition Video puts the analysis results. If you are using the AWS CLI, the parameter name is
StreamProcessorOutput. This must be a S3Destination of an Amazon S3 bucket that you own for a label detection stream processor or a Kinesis data stream ARN for a face search stream processor. -
name(StreamProcessorName) –An identifier you assign to the stream processor. You can use
Nameto manage the stream processor. For example, you can get the current status of the stream processor by calling DescribeStreamProcessor.Nameis idempotent. This is required for both face search and label detection stream processors. -
settings(StreamProcessorSettings) –Input parameters used in a streaming video analyzed by a stream processor. You can use
FaceSearchto recognize faces in a streaming video, or you can useConnectedHometo detect labels. -
role_arn(RoleArn) –The Amazon Resource Number (ARN) of the IAM role that allows access to the stream processor. The IAM role provides Rekognition read permissions for a Kinesis stream. It also provides write permissions to an Amazon S3 bucket and Amazon Simple Notification Service topic for a label detection stream processor. This is required for both face search and label detection stream processors.
-
tags(Optional[TagMap], default:None) –A set of tags (key-value pairs) that you want to attach to the stream processor.
-
kms_key_id(Optional[KmsKeyId], default:None) –The identifier for your AWS Key Management Service key (AWS KMS key). This is an optional parameter for label detection stream processors and should not be used to create a face search stream processor. You can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is used to encrypt results and data published to your Amazon S3 bucket, which includes image frames and hero images. Your source images are unaffected.
-
regions_of_interest(Optional[RegionsOfInterest], default:None) –Specifies locations in the frames where Amazon Rekognition checks for objects or people. You can specify up to 10 regions of interest, and each region has either a polygon or a bounding box. This is an optional parameter for label detection stream processors and should not be used to create a face search stream processor.
-
data_sharing_preference(Optional[StreamProcessorDataSharingPreference], default:None) –Shows whether you are sharing data with Rekognition to improve model performance. You can choose this option at the account level or on a per-stream basis. Note that if you opt out at the account level this setting is ignored on individual streams.
Raises:
-
AccessDeniedException–You are not authorized to perform the action.
-
InternalServerError–Amazon Rekognition experienced a service issue. Try your call again.
-
InvalidParameterException–Input parameter violated a constraint. Validate your parameter before calling the API operation again.
-
LimitExceededException–An Amazon Rekognition service limit was exceeded. For example, if you start too many jobs concurrently, subsequent calls to start operations (ex:
StartLabelDetection) will raise aLimitExceededExceptionexception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Rekognition service limit. -
ProvisionedThroughputExceededException–The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.
-
ResourceInUseException–The specified resource is already being used.
-
ServiceQuotaExceededException–The size of the collection exceeds the allowed limit. For more information, see Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer Guide.
-
ThrottlingException–Amazon Rekognition is temporarily unable to process the request. Try your call again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_rekognition/_services/rekognition.py
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | |