Analyze videos and images
This quickstart guide provides a simplified introduction to analyzing videos and images to generate text using the TwelveLabs Video Understanding Platform. It includes the following:
- A working example for each method: analyze a video and analyze images
- Minimal implementation details
- Core parameters for common use cases
For comprehensive guides, see the Analyze videos and images section.
Key concepts
This section explains the key concepts and terminology used in this guide:
- Asset: Your uploaded content. Once created, you can reference the same asset across multiple operations without uploading the file again.
Workflow
The platform provides two methods to analyze videos and images. Choose the method that fits your use case:
Prerequisites
-
To use the platform, you need an API key:
-
Depending on the programming language you are using, install the TwelveLabs SDK by entering one of the following commands:
-
Your videos must meet the following requirements:
-
Upload limits: Public video URLs up to 4 GB or local videos up to 200 MB. For a video up to 10 GB, use multipart uploads. See the Upload and processing methods page for details.
-
Analysis method: Videos from 1 second to 1 hour. For longer videos, use the asynchronous method in the complete guide.
-
Model capabilities: See the complete requirements for videos
-
-
Your images must meet the following requirements:
- Number of images: one to twenty per request
- Formats: JPEG, PNG, WebP, GIF, and BMP
- File size: ≤ 20 MB per image
- Pixel count: ≤ 16,777,216 pixels per image (width × height)
Analyze videos
Upload your video as an asset, then analyze it with a custom prompt. The platform processes your request synchronously and streams the generated text.
Starter code
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Import the SDK and initialize the client
Create a client instance to interact with the TwelveLabs Video Understanding Platform.
Check the status of the asset
Asset processing is asynchronous. Poll the status of the asset until it is ready before you use it.
Analyze images
Upload your images as assets, then analyze them with a custom prompt. The platform processes your request synchronously and streams the generated text. This quickstart analyzes one image; to include up to twenty in a single request, see the complete guide.
Starter code
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Import the SDK and initialize the client
Create a client instance to interact with the TwelveLabs Video Understanding Platform.
Check the status of the asset
Asset processing is asynchronous. Poll the status of the asset until it is ready before you use it.