Google Cloud Video Intelligence API - Object Tracking in Python Example [Multiple Videos]
Ok, so last week, I had covered how use the Google Cloud Video Intelligence API in Python to run object tracking on a single video.
This is an extension of that post to cover multiple videos in a bucket within GCS.
input_uri field from the API documentation: https://googleapis.dev/python/videointelligence/latest/gapic/v1/types.html
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.INVA LID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). 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.
As I got the wildcard parameter wrong, the google people at Stackoverflow corrected the input_uri field and it worked:
gcs_uri = 'gs://video_intel3/*.*'
Once you run the below Py script, you should find the response.json file in the same bucket in GCS.