Skip to content

Create Stream Processor

rekognition_create_stream_processor R Documentation

Creates an Amazon Rekognition stream processor that you can use to detect and recognize faces or to detect labels in a streaming video

Description

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 the FaceSearch option in Settings, specifying the collection that contains the faces you want to recognize. After you have finished analyzing a streaming video, use stop_stream_processor 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 the ConnectedHome option in settings, and selecting one of the following: PERSON, PET, PACKAGE, ALL You can also specify where in the frame you want Amazon Rekognition to monitor with RegionsOfInterest. When you run the start_stream_processor 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 start_stream_processor 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.

Usage

rekognition_create_stream_processor(Input, Output, Name, Settings,
  RoleArn, Tags, NotificationChannel, KmsKeyId, RegionsOfInterest,
  DataSharingPreference)

Arguments

Input

[required] 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

[required] 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

[required] 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 describe_stream_processor. Name is idempotent. This is required for both face search and label detection stream processors.

Settings

[required] Input parameters used in a streaming video analyzed by a stream processor. You can use FaceSearch to recognize faces in a streaming video, or you can use ConnectedHome to detect labels.

RoleArn

[required] 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

A set of tags (key-value pairs) that you want to attach to the stream processor.

NotificationChannel
KmsKeyId

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.

RegionsOfInterest

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.

DataSharingPreference

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.

Value

A list with the following syntax:

list(
  StreamProcessorArn = "string"
)

Request syntax

svc$create_stream_processor(
  Input = list(
    KinesisVideoStream = list(
      Arn = "string"
    )
  ),
  Output = list(
    KinesisDataStream = list(
      Arn = "string"
    ),
    S3Destination = list(
      Bucket = "string",
      KeyPrefix = "string"
    )
  ),
  Name = "string",
  Settings = list(
    FaceSearch = list(
      CollectionId = "string",
      FaceMatchThreshold = 123.0
    ),
    ConnectedHome = list(
      Labels = list(
        "string"
      ),
      MinConfidence = 123.0
    )
  ),
  RoleArn = "string",
  Tags = list(
    "string"
  ),
  NotificationChannel = list(
    SNSTopicArn = "string"
  ),
  KmsKeyId = "string",
  RegionsOfInterest = list(
    list(
      BoundingBox = list(
        Width = 123.0,
        Height = 123.0,
        Left = 123.0,
        Top = 123.0
      ),
      Polygon = list(
        list(
          X = 123.0,
          Y = 123.0
        )
      )
    )
  ),
  DataSharingPreference = list(
    OptIn = TRUE|FALSE
  )
)