Would it be possible to create a Google Cloud Function that would do a video intelligence annotate request every time I upload a video into a bucket?
Asked
Active
Viewed 196 times
2 Answers
3
Yes:
Create a Cloud Function with a Storage Trigger for the desired bucket
In the Cloud Function, check if the uploaded file is a video
Use the Video Intelligence Client Library to make the request using the file you just uploaded to the bucket

Guillermo Cacheda
- 2,162
- 14
- 23
-
This is not correct. If the video analysis takes more than 540 seconds, the request will timeout. This is not a correct solution, but only a psedue answer. – london_utku Feb 20 '23 at 11:06
0
@Guillerno's answer is not entirely true. For instance, if the video file is more than 1 hour with HD resolution, the timeout of Google Function which is top most 540 seconds will not be sufficient for Video Intelligence to analyse the content and this will simply timeout.
The only way to achieve this is to create a Google App Flex Engine with couple of hours timeout, and execute the AnnotateVideo function in that instance.
For long videos, Cloud Function will not be the solution for Video Intelligence.

london_utku
- 1,070
- 2
- 16
- 36
-
Well, he told you how to solve it generally and he's correct. If your concern is about timeout, you can use the same suggestion but instead of executing in Cloud Functions, send a request to your app engine flex application either directly or using pubsub to perform/finalize the operation. – Chukwuma Nwaugha Feb 19 '23 at 10:49