HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/PraisonAI/docs/agents/video.mdx
---
title: "Video Agent"
sidebarTitle: "Video"
description: "Learn how to create AI agents for video analysis and content understanding."
icon: "video"
---

```mermaid
flowchart LR
    In[Video Input] --> Analyzer[Content Analyzer]
    Analyzer --> Detector[Object Detector]
    Detector --> Transcriber[Text Transcriber]
    Transcriber --> Out[Analysis Report]
    
    style In fill:#8B0000,color:#fff
    style Analyzer fill:#2E8B57,color:#fff
    style Detector fill:#2E8B57,color:#fff
    style Transcriber fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff
```

A workflow demonstrating how the Video Agent can analyze video content, detect objects, and extract meaningful information.

## Quick Start

<Steps>
    <Step title="Install Package">
        First, install the PraisonAI Agents package:
        ```bash
        pip install praisonaiagents
        ```
    </Step>

    <Step title="Set API Key">
        Set your OpenAI API key as an environment variable:
        ```bash
        export OPENAI_API_KEY=your_api_key_here
        ```
    </Step>

    <Step title="Create Script">
        Create a new file `video_analyzer.py`:
        ```python
        from praisonaiagents import Agent, Task, PraisonAIAgents

        # Create Video Analysis Agent
        video_agent = Agent(
            name="VideoAnalyst",
            role="Video Analysis Specialist",
            goal="Analyze videos to extract meaningful information",
            backstory="""You are an expert in computer vision and video analysis.
            You excel at describing content, detecting objects, and understanding context.""",
            llm="gpt-4o-mini",
            self_reflect=False
        )

        # Create video analysis task
        analysis_task = Task(
            name="analyze_video",
            description="""Analyze this video and provide:
                1. Summary of main events
                2. Key objects and people
                3. Text and important information
                4. Context and setting""",
            expected_output="Comprehensive video analysis",
            agent=video_agent,
            images=["video.mp4"]
        )

        # Create PraisonAIAgents instance
        agents = PraisonAIAgents(
            agents=[video_agent],
            tasks=[analysis_task],
            process="sequential",
            verbose=1
        )

        # Run analysis
        agents.start()
        ```
    </Step>
</Steps>

## Understanding Video Analysis

The Video Agent combines multiple capabilities for comprehensive video understanding:

1. **Content Analysis**: Analyzes video scenes and events
2. **Object Detection**: Identifies objects and people
3. **Text Extraction**: Captures text shown in videos
4. **Context Understanding**: Interprets settings and situations

## Features

<CardGroup cols={2}>
  <Card title="Scene Analysis" icon="film">
    Detailed analysis of video scenes.
  </Card>
  <Card title="Object Detection" icon="cube">
    Identification of objects and people.
  </Card>
  <Card title="Text Extraction" icon="closed-captioning">
    Capture of text and captions.
  </Card>
  <Card title="Context Analysis" icon="sitemap">
    Understanding of video context.
  </Card>
</CardGroup>

## Example Usage

```python
# Example: Analyze a presentation video
from praisonaiagents import Agent, Task, PraisonAIAgents

video_agent = Agent(
    name="VideoAnalyst",
    role="Video Analysis Specialist",
    goal="Extract information from presentation videos",
    llm="gpt-4o-mini"
)

# Create presentation analysis task
presentation_task = Task(
    name="analyze_presentation",
    description="""Analyze this presentation video:
        1. Extract key points
        2. Capture slide content
        3. Note speaker's main arguments
        4. Summarize Q&A session""",
    expected_output="Detailed presentation summary",
    agent=video_agent,
    images=["presentation.mp4"]
)

# Run analysis
agents = PraisonAIAgents(
    agents=[video_agent],
    tasks=[presentation_task],
    process="sequential"
)
agents.start()
```

## Next Steps

- Learn about [Prompt Chaining](/features/promptchaining) for complex video analysis
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving analysis accuracy
- Check out the [Image Agent](/agents/image) for still image analysis