-
Notifications
You must be signed in to change notification settings - Fork 4
/
videos.clj
53 lines (47 loc) · 2.14 KB
/
videos.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(ns happygapi.videointelligence.videos
"Cloud Video Intelligence API: videos.
Detects objects, explicit content, and scene changes in videos. It also specifies the region for annotation and transcribes speech to text. Supports both asynchronous API and streaming API.
See: https://cloud.google.com/video-intelligence/docs/api/reference/rest/v1/videos"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn annotate$
"https://cloud.google.com/video-intelligence/docs/api/reference/rest/v1/videos/annotate
Required parameters: none
Optional parameters: none
Body:
{:features [string],
:outputUri string,
:videoContext {:labelDetectionConfig GoogleCloudVideointelligenceV1_LabelDetectionConfig,
:explicitContentDetectionConfig GoogleCloudVideointelligenceV1_ExplicitContentDetectionConfig,
:objectTrackingConfig GoogleCloudVideointelligenceV1_ObjectTrackingConfig,
:speechTranscriptionConfig GoogleCloudVideointelligenceV1_SpeechTranscriptionConfig,
:segments [GoogleCloudVideointelligenceV1_VideoSegment],
:textDetectionConfig GoogleCloudVideointelligenceV1_TextDetectionConfig,
:shotChangeDetectionConfig GoogleCloudVideointelligenceV1_ShotChangeDetectionConfig},
:locationId string,
:inputUri string,
:inputContent string}
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 ["https://www.googleapis.com/auth/cloud-platform"]}
[auth args body]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/post
(util/get-url
"https://videointelligence.googleapis.com/"
"v1/videos:annotate"
#{}
args)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))