---
title: "POST /v1/videos:annotate"
method: POST
path: "/v1/videos:annotate"
tags: ["videos"]
---

# POST /v1/videos:annotate

`POST /v1/videos:annotate`

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).

## Request body

- GoogleCloudVideointelligenceV1AnnotateVideoRequest — Video annotation request.
  - `features` string[] — Required. Requested video annotation features.
  - `locationId` string — Optional. Cloud region where annotation should take place. Supported cloud regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region is specified, the region will be determined based on video file location.
  - `inputUri` string — Input video location. Currently, only [Cloud Storage](https://cloud.google.com/storage/) URIs are supported. URIs 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](https://cloud.google.com/storage/docs/request-endpoints). To identify multiple videos, a video URI may include wildcards in the `object-id`. 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` must be unset.
  - `videoContext` GoogleCloudVideointelligenceV1VideoContext — Video context and/or feature-specific parameters.
    - `explicitContentDetectionConfig` GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig — Config for EXPLICIT_CONTENT_DETECTION.
      - `model` string — Model to use for explicit content detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
    - `personDetectionConfig` GoogleCloudVideointelligenceV1PersonDetectionConfig — Config for PERSON_DETECTION.
      - `includeBoundingBoxes` boolean — Whether bounding boxes are included in the person detection annotation output.
      - `includePoseLandmarks` boolean — Whether to enable pose landmarks detection. Ignored if 'include_bounding_boxes' is set to false.
      - `includeAttributes` boolean — Whether to enable person attributes detection, such as cloth color (black, blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, etc. Ignored if 'include_bounding_boxes' is set to false.
    - `textDetectionConfig` GoogleCloudVideointelligenceV1TextDetectionConfig — Config for TEXT_DETECTION.
      - `languageHints` string[] — Language hint can be specified if the language to be detected is known a priori. It can increase the accuracy of the detection. Language hint must be language code in BCP-47 format. Automatic language detection is performed if no hint is provided.
      - `model` string — Model to use for text detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
    - `segments` GoogleCloudVideointelligenceV1VideoSegment[] — 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.
      - `startTimeOffset` string, google-duration — Time-offset, relative to the beginning of the video, corresponding to the start of the segment (inclusive).
      - `endTimeOffset` string, google-duration — Time-offset, relative to the beginning of the video, corresponding to the end of the segment (inclusive).
    - `faceDetectionConfig` GoogleCloudVideointelligenceV1FaceDetectionConfig — Config for FACE_DETECTION.
      - `model` string — Model to use for face detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
      - `includeBoundingBoxes` boolean — Whether bounding boxes are included in the face annotation output.
      - `includeAttributes` boolean — Whether to enable face attributes detection, such as glasses, dark_glasses, mouth_open etc. Ignored if 'include_bounding_boxes' is set to false.
    - `speechTranscriptionConfig` GoogleCloudVideointelligenceV1SpeechTranscriptionConfig — Config for SPEECH_TRANSCRIPTION.
      - `enableWordConfidence` boolean — Optional. If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
      - `filterProfanity` boolean — 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.
      - `speechContexts` GoogleCloudVideointelligenceV1SpeechContext[] — Optional. A means to provide context to assist the speech recognition.
        - `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](https://cloud.google.com/speech/limits#content).
      - `audioOutputUriPrefix` string — Optional. Legacy field. This field must be a Cloud Storage URI prefix. (e.g., `gs://bucket/path/`).
      - `maxAlternatives` integer — Optional. Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of `SpeechRecognitionAlternative` messages within each `SpeechTranscription`. 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.
      - `audioTracks` integer[] — Optional. For file formats, such as MXF or MKV, supporting multiple audio tracks, specify up to two tracks. Default: track 0.
      - `enableSpeakerDiarization` boolean — Optional. If 'true', enables speaker detection for each recognized word in the top alternative of the recognition result using a speaker_tag provided in the WordInfo. Note: When this is true, we send all the words from the beginning of the audio for the top alternative in every consecutive response. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time.
      - `enableAutomaticPunctuation` boolean — 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."
      - `languageCode` string — Required. *Required* The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported language codes.
      - `diarizationSpeakerCount` integer — Optional. If set, specifies the estimated number of speakers in the conversation. If not set, defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
    - `labelDetectionConfig` GoogleCloudVideointelligenceV1LabelDetectionConfig — Config for LABEL_DETECTION.
      - `stationaryCamera` boolean — 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.
      - `frameConfidenceThreshold` number, float — The confidence threshold we perform filtering on the labels from frame-level detection. If not set, it is set to 0.4 by default. The valid range for this threshold is [0.1, 0.9]. Any value set outside of this range will be clipped. Note: For best results, follow the default threshold. We will update the default threshold everytime when we release a new model.
      - `model` string — Model to use for label detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
      - `videoConfidenceThreshold` number, float — The confidence threshold we perform filtering on the labels from video-level and shot-level detections. If not set, it's set to 0.3 by default. The valid range for this threshold is [0.1, 0.9]. Any value set outside of this range will be clipped. Note: For best results, follow the default threshold. We will update the default threshold everytime when we release a new model.
      - `labelDetectionMode` 'LABEL_DETECTION_MODE_UNSPECIFIED' | 'SHOT_MODE' | 'FRAME_MODE' | 'SHOT_AND_FRAME_MODE' — What labels should be detected with LABEL_DETECTION, in addition to video-level labels or segment-level labels. If unspecified, defaults to `SHOT_MODE`.
    - `shotChangeDetectionConfig` GoogleCloudVideointelligenceV1ShotChangeDetectionConfig — Config for SHOT_CHANGE_DETECTION.
      - `model` string — Model to use for shot change detection. Supported values: "builtin/stable" (the default if unset), "builtin/latest", and "builtin/legacy".
    - `objectTrackingConfig` GoogleCloudVideointelligenceV1ObjectTrackingConfig — Config for OBJECT_TRACKING.
      - `model` string — Model to use for object tracking. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
  - `outputUri` string — Optional. Location where the output (in JSON format) should be stored. Currently, only [Cloud Storage](https://cloud.google.com/storage/) URIs are supported. These 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](https://cloud.google.com/storage/docs/request-endpoints).
  - `inputContent` string, byte — The video data bytes. If unset, the input video(s) should be specified via the `input_uri`. If set, `input_uri` must be unset.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/videointelligence.md) · [All operations](https://skmtc.dev/google/apis/videointelligence/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/videointelligence/revisions/5144920f72af/schema)
