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

Quick Start

1

Enable Video Analysis

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

Ask Questions About Videos

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


Configuration Levels

Based on your needs, configure video analysis at different levels:
// 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

GPT-4o has the best video understanding. Other models may have limited support.
Videos under 5 minutes work best. Split longer videos for better analysis.
Ask about specific moments or details rather than general questions.