Programmable Media

Google Automatic Video Tagging

Last updated: Oct-31-2023

Cloudinary is a cloud-based service that provides an end-to-end image and video management solution including uploads, storage, transformations, optimizations and delivery. Cloudinary offers a rich set of transformation and analysis capabilities and allows you to assign multiple tags to resources for listing and managing your media assets.

The Google Automatic Video Tagging add-on integrates Google's automatic video tagging capabilities with Cloudinary's complete video management and transformation pipeline. Google analyzes video data to automatically identify scenes and suggest tags; a process that would take huge amounts of time and resources if performed manually. Google's technology includes state-of-the-art machine learning approaches that allow it to be trained in the recognition of various visual objects and concepts. When this algorithm is combined with Google's large data sets containing the visual characteristics of videos and their associated tags, the result is outstanding performance in terms of the time needed to process large videos with a high precision rate.

With the Google video tagging add-on, you can extend Cloudinary's powerful semantic data extraction and tagging features, so that your videos can be automatically tagged according to the automatically detected categories and tags in each video.

Tip
You can optionally request the category and tag results in another language or in multiple languages by registering for the Google Translation Add-on in addition to the tagging add-on.

Getting started

Before you can use the Google Automatic Video Tagging add-on:

  • You must have a Cloudinary account. If you don't already have one, you can sign up for a free account.

  • Register for the add-on: make sure you're logged in to your account and then go to the Add-ons page. For more information about add-on registrations, see Registering for add-ons.

  • Keep in mind that many of the examples on this page use our SDKs. For SDK installation and configuration details, see the relevant SDK guide.

  • If you are new to Cloudinary, you may want to take a look at How to integrate Cloudinary in your app for a walk through on the basics of creating and setting up your account, working with SDKs, and then uploading, transforming and delivering assets.

Video recognition and categorization

Take a look at the following video of a turtle:

By setting the categorization parameter to google_video_tagging when calling Cloudinary's upload or update method, Google is used to automatically classify the scenes of the uploaded or specified existing video. For example:

Tips
  • You can use upload presets to centrally define a set of upload options including add-on operations to apply, instead of specifying them in each upload call. You can define multiple upload presets, and apply different presets in different upload scenarios. You can create new upload presets in the Upload page of the Console Settings or using the upload_presets Admin API method. From the Upload page of the Console Settings, you can also select default upload presets to use for image, video, and raw API uploads (respectively) as well as default presets for image, video, and raw uploads performed via the Media Library UI.

    Learn more: Upload presets

  • You can run multiple categorization add-ons on the resource. The categorization parameter accepts a comma-separated list of all the Cloudinary categorization add-ons to run on the resource.

The video analysis and categorization is performed asynchronously after the method call is completed.

Note
The amount of time it takes for analysis and categorization of the video depends on the size and length of the video file itself. You can include a notification_url parameter in your request to get a notification to the requested URL when the categorization is ready.

The response of the upload method indicates that the process is in pending status.

Once the categorization process completes, the information is returned to Cloudinary and stored with your video. The details of the analysis and categorization are also sent to the notification_url if this option was included with your method call. For example:

The information includes the automatic tagging and categorization information identified by the Google Automatic Video Tagging add-on. As can be seen in the example snippet above, various tags were automatically detected in the uploaded video. Each tag is listed together with the start and end times of the relevant video segment, and any relevant categories of the tag . The shot_level is a boolean value indicating whether the segment represents the entire video (false) or just a shot within it (true). The confidence score is a numerical value that represents the confidence level of the detected tag, where 1.0 means 100% confidence.

Adding resource tags to videos

Automatically categorizing your videos is a useful way to organize your Cloudinary media assets. By providing the auto_tagging parameter in an upload or update call for any video where google_video_tagging was run, the video is automatically assigned resource tags based on the detected scene tags and categories. The value of the auto_tagging parameter is the minimum confidence score of a detected tag that should be automatically used as an assigned resource tag. Assigning these resource tags allows you to list and search videos using Cloudinary's API or Web interface.

The following code example automatically tags an uploaded video with all detected tags and categories that have a confidence score higher than 0.4.

You can also use the update method to apply Google auto tagging to already uploaded videos, based on their public IDs, and then automatically tag them according to the detected categories.

For example, the following video was uploaded to Cloudinary with the 'horses' public ID:

The following code sample uses Cloudinary's update method to apply Google's automatic video tagging and categorization to the horses uploaded video, and then automatically assign resource tags based on the categories detected with over a 60% confidence level.

Tip
Whether or not you included a notification_url to get a response from the analysis, you can always use the Admin API's resource method to return the details of a resource, including the scene categories that you already extracted using the upload or update methods.

✔️ Feedback sent!

Rate this page: