Batch Video Warehouse (also known as Video on Demand Warehouse)
helps developers to:

- Import video files from Cloud Storage.
- Import video metadata.
- Analyze video content embeddings.
- Construct and deploy search indexes for AI-powered video search.

> [!IMPORTANT]
> **Important:** Batch Video Warehouse does not copy or store video data. There is no additional storage charge by importing video files.

There are a few basic steps to use a Batch Video Warehouse:

1. **Upload and analyze videos** : Create a [`corpus`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.md.txt), [`upload`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets/upload.md.txt) video assets, generate video embeddings by [`analyze`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets/analyze.md.txt) the video assets. Additionally, developers can define [`data schema`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.dataSchemas.md.txt) and [`annotations`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets.annotations.md.txt) to enrich videos with supplementary metadata.
2. **Build and deploy search indexes** : Create an [`index`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.indexes.md.txt) and [`deploy`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.indexEndpoints/deployIndex.md.txt) the index to an [`index endpoint`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.indexEndpoints.md.txt) for search. A deployed index is managed by a dedicated pool of resources that scales with the size of the index.
3. **Search, browse, and update index data** : Perform semantic [`search`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.indexEndpoints/searchIndexEndpoint.md.txt) for relevant video partitions on a deployed index with text queries, images, or filter criteria on the annotation metadata. Users can also browse the corpus or index contents through [`ListAssets`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets/list.md.txt) and [`ViewIndexedAssets`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.indexes/viewAssets.md.txt) respectively. Batch Video Warehouse provides two ways for updating video assets in the index:
   - **Incremental update** : Use the [`IndexAsset`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets.md.txt) or [`RemoveIndexAsset`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.assets/removeIndex.md.txt) APIs to update one video at a time. This method leads to limited throughput, but low update latency.
   - **Batch update** : Use the [`UpdateIndex`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.indexes/patch.md.txt) API with the [`asset_filter`](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.indexes.md.txt) parameter to fully rebuild the index. This way is preferred when you have a large number of videos to add or remove from the index.

## Supported video formats

Warehouse backends support popular formats such as MP4, AVI, FLV,
MKV, MOV, MXF, WMV, and the formats decodable by
[FFmpeg](https://ffmpeg.org/).

The frontend, which is only for demo purposes, supports MP4 and MKV.

## What's next

Start onboarding with the demo [colab](https://colab.sandbox.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/vision/video_warehouse_sdk.ipynb).