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).
Scopes
You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: videointelligence1 --scope <scope> videos annotate ...
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
GoogleCloudVideointelligenceV1_AnnotateVideoRequest:
features: [string]
input-content: string
input-uri: string
location-id: string
output-uri: string
video-context:
explicit-content-detection-config:
model: string
face-detection-config:
include-attributes: boolean
include-bounding-boxes: boolean
model: string
label-detection-config:
frame-confidence-threshold: number
label-detection-mode: string
model: string
stationary-camera: boolean
video-confidence-threshold: number
object-tracking-config:
model: string
person-detection-config:
include-attributes: boolean
include-bounding-boxes: boolean
include-pose-landmarks: boolean
shot-change-detection-config:
model: string
speech-transcription-config:
audio-tracks: [integer]
diarization-speaker-count: integer
enable-automatic-punctuation: boolean
enable-speaker-diarization: boolean
enable-word-confidence: boolean
filter-profanity: boolean
language-code: string
max-alternatives: integer
text-detection-config:
language-hints: [string]
model: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r . features=et
- Required. Requested video annotation features.
- Each invocation of this argument appends the given value to the array.
input-content=magna
- The video data bytes. If unset, the input video(s) should be specified via the
input_uri
. If set,input_uri
must be unset.
- The video data bytes. If unset, the input video(s) should be specified via the
input-uri=no
- Input video location. Currently, only Cloud 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. To identify multiple videos, a video URI may include wildcards in theobject-id
. Supported wildcards: '*' to match 0 or more characters; '?' to match 1 character. If unset, the input video should be embedded in the request asinput_content
. If set,input_content
must be unset.
- Input video location. Currently, only Cloud Storage URIs are supported. URIs must be specified in the following format:
location-id=ipsum
- 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.
- Optional. Cloud region where annotation should take place. Supported cloud regions are:
output-uri=voluptua.
- Optional. Location where the output (in JSON format) should be stored. Currently, only Cloud 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.
- Optional. Location where the output (in JSON format) should be stored. Currently, only Cloud Storage URIs are supported. These must be specified in the following format:
-
video-context.explicit-content-detection-config model=at
- Model to use for explicit content detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
-
..face-detection-config include-attributes=false
- Whether to enable face attributes detection, such as glasses, dark_glasses, mouth_open etc. Ignored if 'include_bounding_boxes' is set to false.
include-bounding-boxes=true
- Whether bounding boxes are included in the face annotation output.
-
model=amet.
- Model to use for face detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
-
..label-detection-config frame-confidence-threshold=0.6348739250720502
- 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.
label-detection-mode=ipsum
- What labels should be detected with LABEL_DETECTION, in addition to video-level labels or segment-level labels. If unspecified, defaults to
SHOT_MODE
.
- What labels should be detected with LABEL_DETECTION, in addition to video-level labels or segment-level labels. If unspecified, defaults to
model=gubergren
- Model to use for label detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
stationary-camera=true
- 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.
- 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
-
video-confidence-threshold=0.9922470725858205
- 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.
-
..object-tracking-config model=eos
- Model to use for object tracking. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
-
..person-detection-config include-attributes=true
- 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.
include-bounding-boxes=false
- Whether bounding boxes are included in the person detection annotation output.
-
include-pose-landmarks=true
- Whether to enable pose landmarks detection. Ignored if 'include_bounding_boxes' is set to false.
-
..shot-change-detection-config model=duo
- Model to use for shot change detection. Supported values: "builtin/stable" (the default if unset), "builtin/latest", and "builtin/legacy".
-
..speech-transcription-config audio-tracks=51
- Optional. For file formats, such as MXF or MKV, supporting multiple audio tracks, specify up to two tracks. Default: track 0.
- Each invocation of this argument appends the given value to the array.
diarization-speaker-count=8
- 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.
enable-automatic-punctuation=true
- 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."
enable-speaker-diarization=true
- 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.
enable-word-confidence=true
- Optional. If
true
, the top result includes a list of words and the confidence for those words. Iffalse
, no word-level confidence information is returned. The default isfalse
.
- Optional. If
filter-profanity=true
- 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 tofalse
or omitted, profanities won't be filtered out.
- Optional. If set to
language-code=ea
- Required. 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=2
- Optional. Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of
SpeechRecognitionAlternative
messages within eachSpeechTranscription
. The server may return fewer thanmax_alternatives
. Valid values are0
-30
. A value of0
or1
will return a maximum of one. If omitted, will return a maximum of one.
- Optional. Maximum number of recognition hypotheses to be returned. Specifically, the maximum number of
-
..text-detection-config language-hints=lorem
- 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.
- Each invocation of this argument appends the given value to the array.
model=eos
- Model to use for text detection. Supported values: "builtin/stable" (the default if unset) and "builtin/latest".
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").