createStreamProcessor method
- required StreamProcessorInput input,
- required String name,
- required StreamProcessorOutput output,
- required String roleArn,
- required StreamProcessorSettings settings,
Creates an Amazon Rekognition stream processor that you can use to detect and recognize faces in a streaming video.
Amazon Rekognition Video is a consumer of live video from Amazon Kinesis Video Streams. Amazon Rekognition Video sends analysis results to Amazon Kinesis Data Streams.
You provide as input a Kinesis video stream (Input
) and a
Kinesis data stream (Output
) stream. You also specify the
face recognition criteria in Settings
. For example, the
collection containing faces that you want to recognize. 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.
After you have finished analyzing a streaming video, use StopStreamProcessor to stop processing. You can delete the stream processor by calling DeleteStreamProcessor.
May throw AccessDeniedException. May throw InternalServerError. May throw ThrottlingException. May throw InvalidParameterException. May throw LimitExceededException. May throw ResourceInUseException. May throw ProvisionedThroughputExceededException.
Parameter input
:
Kinesis video stream stream that provides the source streaming video. If
you are using the AWS CLI, the parameter name is
StreamProcessorInput
.
Parameter name
:
An identifier you assign to the stream processor. You can use
Name
to manage the stream processor. For example, you can get
the current status of the stream processor by calling
DescribeStreamProcessor. Name
is idempotent.
Parameter output
:
Kinesis data stream stream to which Amazon Rekognition Video puts the
analysis results. If you are using the AWS CLI, the parameter name is
StreamProcessorOutput
.
Parameter roleArn
:
ARN of the IAM role that allows access to the stream processor.
Parameter settings
:
Face recognition input parameters to be used by the stream processor.
Includes the collection to use for face recognition and the face
attributes to detect.
Implementation
Future<CreateStreamProcessorResponse> createStreamProcessor({
required StreamProcessorInput input,
required String name,
required StreamProcessorOutput output,
required String roleArn,
required StreamProcessorSettings settings,
}) async {
ArgumentError.checkNotNull(input, 'input');
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(output, 'output');
ArgumentError.checkNotNull(roleArn, 'roleArn');
ArgumentError.checkNotNull(settings, 'settings');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RekognitionService.CreateStreamProcessor'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Input': input,
'Name': name,
'Output': output,
'RoleArn': roleArn,
'Settings': settings,
},
);
return CreateStreamProcessorResponse.fromJson(jsonResponse.body);
}