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

# AI Video Merger

> Merge voice audio with video and sync tracks

# AI Video Merger

Merge audio tracks with video, sync timing, and normalize audio levels.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
flowchart LR
    A[Video + Audio] --> B[AI Video Merger]
    B --> C[Sync & Merge]
    C --> D[Final Video]
    
    style A fill:#e1f5fe
    style D fill:#c8e6c9
```

## CLI Quickstart

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai recipe run ai-video-merger \
  --input '{"video_path": "video.mp4", "audio_path": "voiceover.mp3"}' \
  --json
```

## Use in Your App (SDK)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import sys
sys.path.insert(0, 'agent_recipes/templates/ai-video-merger')
from tools import merge_audio_video, sync_tracks

# Merge audio with video
result = merge_audio_video(
    video_path="video.mp4",
    audio_path="voiceover.mp3",
    output_path="merged.mp4",
    replace_audio=True
)

# Sync with offset
synced = sync_tracks(
    video_path="video.mp4",
    audio_path="voiceover.mp3",
    output_path="synced.mp4",
    audio_offset=0.5  # Delay audio by 0.5s
)
```

## Input Schema

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "type": "object",
  "properties": {
    "video_path": {"type": "string"},
    "audio_path": {"type": "string"},
    "replace_audio": {"type": "boolean", "default": true},
    "audio_offset": {"type": "number", "default": 0},
    "normalize": {"type": "boolean", "default": true}
  }
}
```

## Output Schema

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "path": "/output/merged.mp4",
  "video_source": "video.mp4",
  "audio_source": "voiceover.mp3",
  "size_bytes": 5000000
}
```

## Features

| Feature       | Description                  |
| ------------- | ---------------------------- |
| Replace Audio | Replace existing audio track |
| Mix Audio     | Mix with existing audio      |
| Sync Offset   | Adjust audio timing          |
| Normalize     | Normalize audio levels       |

## Dependencies

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Requires ffmpeg
brew install ffmpeg  # macOS
```

## Related Tools

* [AI B-roll Builder](/docs/examples/agent-recipes/creator-suite/ai-broll-builder)
* [AI Voiceover Generator](/docs/examples/agent-recipes/creator-suite/ai-voiceover-generator)
