PHPackages                             subhashladumor1/laravel-ai-video - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. subhashladumor1/laravel-ai-video

ActiveLibrary[Image &amp; Media](/categories/media)

subhashladumor1/laravel-ai-video
================================

Laravel AI Video is a high-performance, multi-model AI video generator for Laravel AI SDK. Create text-to-video, image-to-video, marketing videos, social media reels, and multi-aspect ratio content using modern AI models like Runway, Stability, Pika, and OpenAI.

1.0.2(4mo ago)06MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Feb 14Pushed 4mo agoCompare

[ Source](https://github.com/subhashladumor1/laravel-ai-video)[ Packagist](https://packagist.org/packages/subhashladumor1/laravel-ai-video)[ RSS](/packages/subhashladumor1-laravel-ai-video/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

Laravel AI Video – High-Performance Multi-Model Video Engine
============================================================

[](#laravel-ai-video--high-performance-multi-model-video-engine)

[![Latest Version on Packagist](https://camo.githubusercontent.com/83e81902b652ee7fae8614176495d9d9aca3e6712eca34c7174d3beb35a095ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737562686173686c6164756d6f72312f6c61726176656c2d61692d766964656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/subhashladumor1/laravel-ai-video)[![License](https://camo.githubusercontent.com/b5613e4e72e37c1af370b36a6bff65fbbcf1630ebe3176313171b38b29c51f42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737562686173686c6164756d6f72312f6c61726176656c2d61692d766964656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/subhashladumor1/laravel-ai-video)[![Total Downloads](https://camo.githubusercontent.com/1c2825d8a5c0c7e9b772c8103eacf7eac7cc9cf067f6061f4663e65423bb0b8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737562686173686c6164756d6f72312f6c61726176656c2d61692d766964656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/subhashladumor1/laravel-ai-video)

**Laravel AI Video** is a comprehensive, production-ready package for generating cinematic AI videos. It acts as an orchestration layer, combining the best AI models for scripting, visuals, motion, and voice into a single, unified pipeline.

Whether you need to automate **Social Media Reels**, create **Product Ads**, or generate **Storytelling Content**, this package handles the complex workflow of chaining AI APIs and rendering the final output.

---

🌟 Features
----------

[](#-features)

- **🎬 Multi-Model Orchestration ("Composed" Driver)**:
    - **Scripting**: OpenAI GPT-4o breaks prompts into cinematic scenes.
    - **Visuals**: OpenAI DALL-E 3 generates high-consistency scene images.
    - **Motion**: Runway Gen-4 Turbo / Leonardo Kling 2.1 brings images to life.
    - **Voice**: OpenAI TTS-1 adds synchronized voiceovers.
    - **Rendering**: FFmpeg merges everything with transitions and subtitles.
- **🖼️ Image-to-Video**: Support for animating images using **Runway (Gen-4)**, **Leonardo (Kling 2.1)**, or **OpenAI (Sora)**.
- **📱 Smart Templates**: Built-in aspect ratios for **Instagram/TikTok (9:16)**, **YouTube (16:9)**, and **Feeds (1:1)**.
- **🛡️ AI Guard Integration**: Prevents API bill shock by estimating costs *before* execution and strictly enforcing budgets.
- **⚡ High-Performance Architecture**:
    - Queue-based asynchronous processing.
    - Streams temporary files to avoid memory overflows.
    - Parallel execution where possible (dependent on driver).

---

🛠️ How It Works
---------------

[](#️-how-it-works)

The **Composed Driver** automates the entire video production lifecycle:

 ```
graph TD
    User[User Prompt] -->|1. Plan| Planner(Scene Planner / GPT-4o / Gemini 1.5)
    Planner -->|JSON Scenes| Manager{Video Manager}

    subgraph "Parallel Processing Per Scene"
        Manager -->|Describe| GenImg[Image Gen / DALL-E 3]
        GenImg -->|Image| Animate[Motion / Runway / Kling / Sora]
        Manager -->|Text| TTS[Voice / OpenAI TTS]
    end

    Animate -->|Video Clip| Renderer[FFmpeg Renderer]
    TTS -->|Audio Clip| Renderer
    Planner -->|Subtitles| Renderer

    Renderer -->|Merge & Render| Final[Final MP4 Output]
```

      Loading ---

🚀 Installation
--------------

[](#-installation)

1. **Install via Composer:**

    ```
    composer require subhashladumor1/laravel-ai-video
    ```
2. **Publish Configuration:**

    ```
    php artisan vendor:publish --tag=ai-video-config
    ```
3. **Install FFmpeg:**Ensure `ffmpeg` and `ffprobe` are installed on your server.

    ```
    # Ubuntu/Debian
    sudo apt update && sudo apt install ffmpeg
    ```
4. **Configure `.env`:**Add your API keys. The package works best with multiple providers enabled.

    ```
    OPENAI_API_KEY=sk-...
    RUNWAY_API_KEY=...
    LEONARDO_API_KEY=...
    GEMINI_API_KEY=...

    # Enable the Budget Guard
    AI_VIDEO_GUARD_ENABLED=true
    ```

---

📖 Complete Usage Guide
----------------------

[](#-complete-usage-guide)

### 1. Text-to-Video (The "Composed" Pipeline)

[](#1-text-to-video-the-composed-pipeline)

This is the most powerful feature. It creates a full video from a simple text prompt.

**Basic Usage:**

```
use Subhashladumor1\LaravelAiVideo\Facades\AiVideo;

$path = AiVideo::driver('composed')->textToVideo(
    "A cyberpunk detective walking through neon-lit rainy streets of Tokyo.",
    [
        'duration' => 15, // Total video duration (approx)
        'template' => 'youtube-short' // 9:16 Aspect Ratio
    ]
);

return response()->download($path);
```

**Advanced Usage (Asynchronous Job):**Recommended for production to avoid timeout issues.

```
use Subhashladumor1\LaravelAiVideo\Jobs\ProcessVideoJob;

ProcessVideoJob::dispatch(
    'text-to-video',
    "Create a 30-second commercial for a new eco-friendly coffee brand.",
    [
        'template' => 'instagram-reel',
        'voice_id' => 'alloy',
        'style' => 'Cinematic, Warm Lighting, Slow Motion',
        'fps' => 30
    ],
    'composed'
);
```

### 2. Image-to-Video (Motion Generation)

[](#2-image-to-video-motion-generation)

Ideal for bringing product photography or static assets to life. Supports **Runway**, **Leonardo**, and **Sora**.

```
use Subhashladumor1\LaravelAiVideo\Facades\AiVideo;

// Using Runway Gen-4 Turbo
$videoPath = AiVideo::driver('runway')->imageToVideo(
    public_path('images/product-shoe.jpg'),
    [
        'prompt' => 'Cinematic slow motion, floating in air', // Text prompt required for control
        'duration' => 10,
        'model' => 'gen4_turbo'
    ]
);

// Using Leonardo (Kling 2.1)
$videoPath2 = AiVideo::driver('leonardo')->imageToVideo(
    public_path('images/portrait.jpg'),
    [
        'prompt' => 'Character smiles and waves',
        'model' => 'KLING2_1'
    ]
);
```

### 3. Scene Planning (Scripting Only)

[](#3-scene-planning-scripting-only)

Use the AI Director to break down a script into visual scenes without generating the video yet. Useful for UI previews.

```
$scenes = AiVideo::driver('openai')->generateScenes(
    "A history of the Roman Empire in 60 seconds."
);

// Returns:
// [
//    [
//      'scene_number' => 1,
//      'visual_description' => 'Aerial view of the Colosseum at sunset...',
//      'voiceover_text' => 'It began as a small city-state...',
//      'duration_seconds' => 5
//    ],
//    ...
// ]
```

### 4. Voiceover Generation (TTS)

[](#4-voiceover-generation-tts)

Generate high-quality AI voiceovers directly.

```
$audioPath = AiVideo::driver('openai')->generateVoice(
    "Welcome to the future of video generation.",
    'nova', // Voice options: alloy, echo, fable, onyx, nova, shimmer
    ['model' => 'tts-1-hd']
);
```

---

🛡️ AI Guard &amp; Cost Control
------------------------------

[](#️-ai-guard--cost-control)

This package includes a **Budget Enforcement System**. It estimates the cost of every operation *before* it runs.

**How to Configure:**In `config/ai-video.php`:

```
'guard' => [
    'enabled' => true,
    'cost_limit_per_video' => 5.00, // Maximum USD per video
],
```

**Usage Flow:**

```
try {
    // This will throw an Exception if estimated cost > $5.00
    AiVideo::driver('composed')->textToVideo("An extremely long 1-hour movie description...");
} catch (\Exception $e) {
    // "Estimated cost $12.50 exceeds budget limit of $5.00"
    return back()->with('error', $e->getMessage());
}
```

---

📖 Function Reference
--------------------

[](#-function-reference)

### `VideoDriver` Interface

[](#videodriver-interface)

The Facade `AiVideo::driver('name')` returns an instance implementing these methods:

MethodDescriptionOptions`textToVideo($prompt, $opts)`Generates full video from text.`duration`, `template`, `style``imageToVideo($path, $opts)`Animates a static image.`motion_bucket_id`, `seed``generateScenes($script)`Returns array of scene objects.`model` (e.g., gpt-4o)`generateVoice($text, $voice)`Creates MP3 audio from text.`output_path`, `speed``estimateCost($type, $params)`Returns float ($) cost estimate.`input`### Supported Templates

[](#supported-templates)

Templates control the Output Resolution and default styling.

TemplateAspect RatioResolutionBest For`youtube-standard`16:91920x1080YouTube, TV, Desktop`youtube-short`9:161080x1920Shorts, TikTok, Reels`instagram-reel`9:161080x1920Instagram Stories/Reels`square-post`1:11080x1080FB/Insta Feed, Product Ads`portrait`4:51080x1350Mobile Feed---

🏗️ Extending
------------

[](#️-extending)

You can create your own drivers by implementing `Subhashladumor1\LaravelAiVideo\Contracts\VideoDriver`.

```
namespace App\Drivers;

use Subhashladumor1\LaravelAiVideo\Contracts\VideoDriver;

class MyCustomDriver implements VideoDriver
{
    public function textToVideo(string $prompt, array $options = []): string
    {
        // Call your custom AI API here
        return 'path/to/video.mp4';
    }

    // implement other methods...
}
```

Register it in `AppServiceProvider`:

```
AiVideo::extend('custom', function ($app) {
    return new MyCustomDriver();
});
```

---

🧪 Testing
---------

[](#-testing)

```
composer test
```

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance75

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f38ba994870f0b2c8855e3f4614b1a8ecfecda7114fa4a8d261b9c6bb192b20b?d=identicon)[subhashladumor1](/maintainers/subhashladumor1)

---

Top Contributors

[![subhashladumor1](https://avatars.githubusercontent.com/u/79623012?v=4)](https://github.com/subhashladumor1 "subhashladumor1 (13 commits)")

---

Tags

laravelaivideoopenaistabilityrunwaytext-to-videoimage-to-videopika

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/subhashladumor1-laravel-ai-video/health.svg)

```
[![Health](https://phpackages.com/badges/subhashladumor1-laravel-ai-video/health.svg)](https://phpackages.com/packages/subhashladumor1-laravel-ai-video)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
