Skip to content

aws.rekognition.get_segment_detection

Example SQL Queries

SELECT * FROM
aws.rekognition.get_segment_detection
WHERE
"job_id" = 'VALUE';

Description

Gets the segment detection results of a Amazon Rekognition Video analysis started by StartSegmentDetection.

Segment detection with Amazon Rekognition Video is an asynchronous operation. You start segment detection by calling StartSegmentDetection which returns a job identifier (JobId). When the segment detection operation finishes, Amazon Rekognition publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartSegmentDetection. To get the results of the segment detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. if so, call GetSegmentDetection and pass the job identifier (JobId) from the initial call of StartSegmentDetection.

GetSegmentDetection returns detected segments in an array (Segments) of SegmentDetection objects. Segments is sorted by the segment types specified in the SegmentTypes input parameter of StartSegmentDetection. Each element of the array includes the detected segment, the precentage confidence in the acuracy of the detected segment, the type of the segment, and the frame in which the segment was detected.

Use SelectedSegmentTypes to find out the type of segment detection requested in the call to StartSegmentDetection.

Use the MaxResults parameter to limit the number of segment detections returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetSegmentDetection and populate the NextToken request parameter with the token value returned from the previous call to GetSegmentDetection.

For more information, see Detecting video segments in stored video in the Amazon Rekognition Developer Guide.

Table Definition

Column NameColumn Data Type
job_id Required Input Column

Job identifier for the segment detection operation for which you want to obtain results. The job identifer is returned by an initial call to StartSegmentDetection.

VARCHAR
max_results Input Column

Maximum number of results to return per paginated call. The largest value you can specify is 1000.

BIGINT
next_token Input Column

If the previous response was incomplete (because there are more labels to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of text.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
audio_metadata

An array of objects. There can be multiple audio streams. Each AudioMetadata object contains metadata for a single audio stream. Audio information in an AudioMetadata objects includes the audio codec, the number of audio channels, the duration of the audio stream, and the sample rate. Audio metadata is returned in each page of information returned by GetSegmentDetection.

STRUCT(
"codec" VARCHAR,
"duration_millis" BIGINT,
"sample_rate" BIGINT,
"number_of_channels" BIGINT
)[]
Show child fields
audio_metadata[]
Show child fields
audio_metadata[].codec

The audio codec used to encode or decode the audio stream.

audio_metadata[].duration_millis

The duration of the audio stream in milliseconds.

audio_metadata[].number_of_channels

The number of audio channels in the segment.

audio_metadata[].sample_rate

The sample rate for the audio stream.

job_status

Current status of the segment detection job.

VARCHAR
job_tag

A job identifier specified in the call to StartSegmentDetection and returned in the job completion notification sent to your Amazon Simple Notification Service topic.

VARCHAR
segments

An array of segments detected in a video. The array is sorted by the segment types (TECHNICAL_CUE or SHOT) specified in the SegmentTypes input parameter of StartSegmentDetection. Within each segment type the array is sorted by timestamp values.

STRUCT(
"type" VARCHAR,
"start_timestamp_millis" BIGINT,
"end_timestamp_millis" BIGINT,
"duration_millis" BIGINT,
"start_timecode_smpte" VARCHAR,
"end_timecode_smpte" VARCHAR,
"duration_smpte" VARCHAR,
"technical_cue_segment" STRUCT(
"type" VARCHAR,
"confidence" DOUBLE
),
"shot_segment" STRUCT(
"index" BIGINT,
"confidence" DOUBLE
),
"start_frame_number" BIGINT,
"end_frame_number" BIGINT,
"duration_frames" BIGINT
)[]
Show child fields
segments[]
Show child fields
segments[].duration_frames

The duration of a video segment, expressed in frames.

segments[].duration_millis

The duration of the detected segment in milliseconds.

segments[].duration_smpte

The duration of the timecode for the detected segment in SMPTE format.

segments[].end_frame_number

The frame number at the end of a video segment, using a frame index that starts with 0.

segments[].end_timecode_smpte

The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates).

segments[].end_timestamp_millis

The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down.

segments[].shot_segment

If the segment is a shot detection, contains information about the shot detection.

Show child fields
segments[].shot_segment.confidence

The confidence that Amazon Rekognition Video has in the accuracy of the detected segment.

segments[].shot_segment.index

An Identifier for a shot detection segment detected in a video.

segments[].start_frame_number

The frame number of the start of a video segment, using a frame index that starts with 0.

segments[].start_timecode_smpte

The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates).

segments[].start_timestamp_millis

The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 millis.

segments[].technical_cue_segment

If the segment is a technical cue, contains information about the technical cue.

Show child fields
segments[].technical_cue_segment.confidence

The confidence that Amazon Rekognition Video has in the accuracy of the detected segment.

segments[].technical_cue_segment.type

The type of the technical cue.

segments[].type

The type of the segment. Valid values are TECHNICAL_CUE and SHOT.

selected_segment_types

An array containing the segment types requested in the call to StartSegmentDetection.

STRUCT(
"type" VARCHAR,
"model_version" VARCHAR
)[]
Show child fields
selected_segment_types[]
Show child fields
selected_segment_types[].model_version

The version of the model used to detect segments.

selected_segment_types[].type

The type of a segment (technical cue or shot detection).

status_message

If the job fails, StatusMessage provides a descriptive error message.

VARCHAR
video

Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.

STRUCT(
"s3_object" STRUCT(
"bucket" VARCHAR,
"name" VARCHAR,
"version" VARCHAR
)
)
Show child fields
video.s3_object

The Amazon S3 bucket name and file name for the video.

Show child fields
video.s3_object.bucket

Name of the S3 bucket.

video.s3_object.name

S3 object key name.

video.s3_object.version

If the bucket is versioning enabled, you can specify the object version.

video_metadata

Currently, Amazon Rekognition Video returns a single object in the VideoMetadata array. The object contains information about the video stream in the input file that Amazon Rekognition Video chose to analyze. The VideoMetadata object includes the video codec, video format and other information. Video metadata is returned in each page of information returned by GetSegmentDetection.

STRUCT(
"codec" VARCHAR,
"duration_millis" BIGINT,
"format" VARCHAR,
"frame_rate" DOUBLE,
"frame_height" BIGINT,
"frame_width" BIGINT,
"color_range" VARCHAR
)[]
Show child fields
video_metadata[]
Show child fields
video_metadata[].codec

Type of compression used in the analyzed video.

video_metadata[].color_range

A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).

video_metadata[].duration_millis

Length of the video in milliseconds.

video_metadata[].format

Format of the analyzed video. Possible values are MP4, MOV and AVI.

video_metadata[].frame_height

Vertical pixel dimension of the video.

video_metadata[].frame_rate

Number of frames per second in the video.

video_metadata[].frame_width

Horizontal pixel dimension of the video.