> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Video

> Analyze and understand video content with AI

Agents can analyze videos - describe content, answer questions, and extract key moments.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Video Analysis"
        A[👤 User] --> B[🤖 Agent]
        B --> C[🎬 Video]
        C --> D[📝 Analysis]
    end

    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

    class B agent
    class A,C,D tool
```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    import { Agent } from 'praisonai';

    const agent = new Agent({
      instructions: 'You analyze videos and describe what you see',
      video: true
    });

    await agent.chat('Analyze https://example.com/video.mp4');
    ```
  </Step>

  <Step title="With Configuration">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    await agent.chat([
      { role: 'user', content: [
        { type: 'text', text: 'What is happening in this video?' },
        { type: 'video', url: 'https://example.com/video.mp4' }
      ]}
    ]);
    ```
  </Step>
</Steps>

***

## User Interaction Flow

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Agent
    participant Video
    
    User->>Agent: "Analyze this video"
    Agent->>Video: Extract frames
    Video-->>Agent: Visual content
    Agent-->>User: "This video shows..."
```

***

## Configuration Levels

Based on your needs, configure video analysis at different levels:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
// Level 1: Bool - Enable with defaults
const agent = new Agent({ video: true });

// Level 2: Dict - Custom options
const agent = new Agent({
  video: {
    maxDuration: 300,
    frameRate: 1
  }
});

// Level 3: Instance - Full control
import { VideoAgent } from 'praisonai';

const videoAgent = new VideoAgent({
  llm: 'gpt-4o',
  maxDuration: 600,
  transcribeAudio: true
});
```

***

## API Reference

<Card title="VideoConfig" icon="code" href="/docs/sdk/reference/typescript/classes/VideoConfig">
  Complete configuration options
</Card>

<Card title="VideoAgent" icon="robot" href="/docs/sdk/reference/typescript/classes/VideoAgent">
  Full class documentation
</Card>

***

## What You Can Do

| Action         | Example                                       |
| -------------- | --------------------------------------------- |
| Describe video | `agent.chat('What happens in this video?')`   |
| Ask questions  | `agent.chat('How many people appear?')`       |
| Get summary    | `agent.chat('Summarize this in 2 sentences')` |
| Find moments   | `agent.chat('List the key events')`           |

***

## Best Practices

<AccordionGroup>
  <Accordion title="Use GPT-4o for video">
    GPT-4o has the best video understanding. Other models may have limited support.
  </Accordion>

  <Accordion title="Keep videos short">
    Videos under 5 minutes work best. Split longer videos for better analysis.
  </Accordion>

  <Accordion title="Be specific in questions">
    Ask about specific moments or details rather than general questions.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Vision" icon="eye" href="/docs/js/vision">
    Analyze images
  </Card>

  <Card title="Audio" icon="headphones" href="/docs/js/audio">
    Process audio content
  </Card>
</CardGroup>
