> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Analyze and segment videos

> Analyze videos to generate text and extract structured, timestamped segments.

The TwelveLabs Python SDK provides methods to analyze videos, generate text based on their content, and extract structured, timestamped segments.

[**Related quickstart notebook**](https://colab.research.google.com/github/twelvelabs-io/twelvelabs-developer-experience/blob/main/quickstarts/TwelveLabs_Quickstart_Analyze.ipynb)

# Choose a method

* For videos under 1 hour, use the [`analyze`](/v1.3/sdk-reference/python/analyze-videos/sync-analysis#sync-analysis) or [`analyze_stream`](/v1.3/sdk-reference/python/analyze-videos/sync-analysis#sync-analysis-with-streaming-responses) method. These methods return results immediately in the response.
* For videos up to 2 hours, or for video segmentation, use the [`analyze_async.tasks.create`](/v1.3/sdk-reference/python/analyze-videos/async-analysis#create-an-async-analysis-task) method. This method processes videos asynchronously.
* For multiple videos, use the [`analyze_async.batches.create`](/v1.3/sdk-reference/python/analyze-videos/batch-analysis#create-a-batch) method. This method processes multiple analysis requests in one batch.