Package google.cloud.videointelligence.v1

Index

VideoIntelligenceService

Service that implements Google Cloud Video Intelligence API.

AnnotateVideo

rpc AnnotateVideo(AnnotateVideoRequest) returns (Operation)

Performs asynchronous video annotation. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains AnnotateVideoProgress (progress). Operation.response contains AnnotateVideoResponse (results).

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AnnotateVideoProgress

Video annotation progress. Included in the metadata field of the Operation returned by the GetOperation call of the google::longrunning::Operations service.

Fields
annotation_progress[]

VideoAnnotationProgress

Progress metadata for all videos specified in AnnotateVideoRequest.

AnnotateVideoRequest

Video annotation request.

Fields
input_uri

string

Input video location. Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: gs://bucket-id/object-id (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see Request URIs. A video URI may include wildcards in object-id, and thus identify multiple videos. Supported wildcards: '*' to match 0 or more characters; '?' to match 1 character. If unset, the input video should be embedded in the request as input_content. If set, input_content should be unset.

input_content

bytes

The video data bytes. If unset, the input video(s) should be specified via input_uri. If set, input_uri should be unset.

features[]

Feature

Requested video annotation features.

video_context

VideoContext

Additional video context and/or feature-specific parameters.

output_uri

string

Optional location where the output (in JSON format) should be stored. Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: gs://bucket-id/object-id (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see Request URIs.

location_id

string

Optional cloud region where annotation should take place. Supported cloud regions: us-east1, us-west1, europe-west1, asia-east1. If no region is specified, a region will be determined based on video file location.

AnnotateVideoResponse

Video annotation response. Included in the response field of the Operation returned by the GetOperation call of the google::longrunning::Operations service.

Fields
annotation_results[]

VideoAnnotationResults

Annotation results for all videos specified in AnnotateVideoRequest.

Entity

Detected entity from video analysis.

Fields
entity_id

string

Opaque entity ID. Some IDs may be available in Google Knowledge Graph Search API.

description

string

Textual description, e.g. Fixed-gear bicycle.

language_code

string

Language code for description in BCP-47 format.

ExplicitContentAnnotation

Explicit content annotation (based on per-frame visual signals only). If no explicit content has been detected in a frame, no annotations are present for that frame.

Fields
frames[]

ExplicitContentFrame

All video frames where explicit content was detected.

ExplicitContentDetectionConfig

Config for EXPLICIT_CONTENT_DETECTION.

Fields
model

string

Model to use for explicit content detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".

ExplicitContentFrame

Video frame level annotation results for explicit content.

Fields
time_offset

Duration

Time-offset, relative to the beginning of the video, corresponding to the video frame for this location.

pornography_likelihood

Likelihood

Likelihood of the pornography content..

Feature

Video annotation feature.

Enums
FEATURE_UNSPECIFIED Unspecified.
LABEL_DETECTION Label detection. Detect objects, such as dog or flower.
SHOT_CHANGE_DETECTION Shot change detection.
EXPLICIT_CONTENT_DETECTION Explicit content detection.
SPEECH_TRANSCRIPTION Speech transcription.

LabelAnnotation

Label annotation.

Fields
entity

Entity

Detected entity.

category_entities[]

Entity

Common categories for the detected entity. E.g. when the label is Terrier the category is likely dog. And in some cases there might be more than one categories e.g. Terrier could also be a pet.

segments[]

LabelSegment

All video segments where a label was detected.

frames[]

LabelFrame

All video frames where a label was detected.

LabelDetectionConfig

Config for LABEL_DETECTION.

Fields
label_detection_mode

LabelDetectionMode

What labels should be detected with LABEL_DETECTION, in addition to video-level labels or segment-level labels. If unspecified, defaults to SHOT_MODE.

stationary_camera

bool

Whether the video has been shot from a stationary (i.e. non-moving) camera. When set to true, might improve detection accuracy for moving objects. Should be used with SHOT_AND_FRAME_MODE enabled.

model

string

Model to use for label detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".

LabelDetectionMode

Label detection mode.

Enums
LABEL_DETECTION_MODE_UNSPECIFIED Unspecified.
SHOT_MODE Detect shot-level labels.
FRAME_MODE Detect frame-level labels.
SHOT_AND_FRAME_MODE Detect both shot-level and frame-level labels.

LabelFrame

Video frame level annotation results for label detection.

Fields
time_offset

Duration

Time-offset, relative to the beginning of the video, corresponding to the video frame for this location.

confidence

float

Confidence that the label is accurate. Range: [0, 1].

LabelSegment

Video segment level annotation results for label detection.

Fields
segment

VideoSegment

Video segment where a label was detected.

confidence

float

Confidence that the label is accurate. Range: [0, 1].

Likelihood

Bucketized representation of likelihood.

Enums
LIKELIHOOD_UNSPECIFIED Unspecified likelihood.
VERY_UNLIKELY Very unlikely.
UNLIKELY Unlikely.
POSSIBLE Possible.
LIKELY Likely.
VERY_LIKELY Very likely.

ShotChangeDetectionConfig

Config for SHOT_CHANGE_DETECTION.

Fields
model

string

Model to use for shot change detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".

SpeechContext

Provides "hints" to the speech recognizer to favor specific words and phrases in the results.

Fields
phrases[]

string

Optional A list of strings containing words and phrases "hints" so that the speech recognition is more likely to recognize them. This can be used to improve the accuracy for specific words and phrases, for example, if specific commands are typically spoken by the user. This can also be used to add additional words to the vocabulary of the recognizer. See usage limits.

SpeechRecognitionAlternative

Alternative hypotheses (a.k.a. n-best list).

Fields
transcript

string

Transcript text representing the words that the user spoke.

confidence

float

The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is typically provided only for the top hypothesis, and only for is_final=true results. Clients should not rely on the confidence field as it is not guaranteed to be accurate or consistent. The default of 0.0 is a sentinel value indicating confidence was not set.

words[]

WordInfo

A list of word-specific information for each recognized word.

SpeechTranscription

A speech recognition result corresponding to a portion of the audio.

Fields
alternatives[]

SpeechRecognitionAlternative

May contain one or more recognition hypotheses (up to the maximum specified in max_alternatives). These alternatives are ordered in terms of accuracy, with the top (first) alternative being the most probable, as ranked by the recognizer.

SpeechTranscriptionConfig

Config for SPEECH_TRANSCRIPTION.

Fields
language_code

string

Required The language of the supplied audio as a BCP-47 language tag. Example: "en-US". See Language Support for a list of the currently supported language codes.

max_alternatives

int32

Optional Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of SpeechRecognitionAlternative messages within each SpeechRecognitionResult. The server may return fewer than max_alternatives. Valid values are 0-30. A value of 0 or 1 will return a maximum of one. If omitted, will return a maximum of one.

filter_profanity

bool

Optional If set to true, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, e.g. "f***". If set to false or omitted, profanities won't be filtered out.

speech_contexts[]

SpeechContext

Optional A means to provide context to assist the speech recognition.

enable_automatic_punctuation

bool

Optional If 'true', adds punctuation to recognition result hypotheses. This feature is only available in select languages. Setting this for requests in other languages has no effect at all. The default 'false' value does not add punctuation to result hypotheses. NOTE: "This is currently offered as an experimental service, complimentary to all users. In the future this may be exclusively available as a premium feature."

audio_tracks[]

int32

Optional For file formats, such as MXF or MKV, supporting multiple audio tracks, specify up to two tracks. Default: track 0.

VideoAnnotationProgress

Annotation progress for a single video.

Fields
input_uri

string

Video file location in Google Cloud Storage.

progress_percent

int32

Approximate percentage processed thus far. Guaranteed to be 100 when fully processed.

start_time

Timestamp

Time when the request was received.

update_time

Timestamp

Time of the most recent update.

VideoAnnotationResults

Annotation results for a single video.

Fields
input_uri

string

Video file location in Google Cloud Storage.

segment_label_annotations[]

LabelAnnotation

Label annotations on video level or user specified segment level. There is exactly one element for each unique label.

shot_label_annotations[]

LabelAnnotation

Label annotations on shot level. There is exactly one element for each unique label.

frame_label_annotations[]

LabelAnnotation

Label annotations on frame level. There is exactly one element for each unique label.

shot_annotations[]

VideoSegment

Shot annotations. Each shot is represented as a video segment.

explicit_annotation

ExplicitContentAnnotation

Explicit content annotation.

speech_transcriptions[]

SpeechTranscription

Speech transcription.

error

Status

If set, indicates an error. Note that for a single AnnotateVideoRequest some videos may succeed and some may fail.

VideoContext

Video context and/or feature-specific parameters.

Fields
segments[]

VideoSegment

Video segments to annotate. The segments may overlap and are not required to be contiguous or span the whole video. If unspecified, each video is treated as a single segment.

label_detection_config

LabelDetectionConfig

Config for LABEL_DETECTION.

shot_change_detection_config

ShotChangeDetectionConfig

Config for SHOT_CHANGE_DETECTION.

explicit_content_detection_config

ExplicitContentDetectionConfig

Config for EXPLICIT_CONTENT_DETECTION.

speech_transcription_config

SpeechTranscriptionConfig

Config for SPEECH_TRANSCRIPTION.

VideoSegment

Video segment.

Fields
start_time_offset

Duration

Time-offset, relative to the beginning of the video, corresponding to the start of the segment (inclusive).

end_time_offset

Duration

Time-offset, relative to the beginning of the video, corresponding to the end of the segment (inclusive).

WordInfo

Word-specific information for recognized words. Word information is only included in the response when certain request parameters are set, such as enable_word_time_offsets.

Fields
start_time

Duration

Time offset relative to the beginning of the audio, and corresponding to the start of the spoken word. This field is only set if enable_word_time_offsets=true and only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.

end_time

Duration

Time offset relative to the beginning of the audio, and corresponding to the end of the spoken word. This field is only set if enable_word_time_offsets=true and only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.

word

string

The word corresponding to this set of information.

Var denne side nyttig? Giv os en anmeldelse af den:

Send feedback om...

Cloud Video Intelligence API