Video

Analyze and understand video content with AI

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

Diagram

Video Analysis

👤 User

🤖 Agent

🎬 Video

📝 Analysis

Quick Start

  1. Simple Usage
    typescript
    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');
  2. With Configuration
    typescript
    await agent.chat([
      { role: 'user', content: [
        { type: 'text', text: 'What is happening in this video?' },
        { type: 'video', url: 'https://example.com/video.mp4' }
      ]}
    ]);

User Interaction Flow

Diagram
VideoAgentUserVideoAgentUser“Analyze this video”Extract framesVisual content“This video shows…”

Configuration Levels

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

typescript
// 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

VideoConfig

Complete configuration options

VideoAgent

Full class documentation


What You Can Do

ActionExample
Describe videoagent.chat('What happens in this video?')
Ask questionsagent.chat('How many people appear?')
Get summaryagent.chat('Summarize this in 2 sentences')
Find momentsagent.chat('List the key events')

Best Practices

Use GPT-4o for video

GPT-4o has the best video understanding. Other models may have limited support.

Keep videos short

Videos under 5 minutes work best. Split longer videos for better analysis.

Be specific in questions

Ask about specific moments or details rather than general questions.


Related