Video
Analyze and understand video content with AI
Agents can analyze videos – describe content, answer questions, and extract key moments.
Quick Start
- 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'); - 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
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
VideoConfigComplete configuration options
VideoAgentFull class documentation
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
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.