Skip to content

Video Support#305

Open
JonPurvis wants to merge 5 commits intolaravel:0.xfrom
JonPurvis:video-support
Open

Video Support#305
JonPurvis wants to merge 5 commits intolaravel:0.xfrom
JonPurvis:video-support

Conversation

@JonPurvis
Copy link
Copy Markdown

Hey 👋

This PR lets you generate videos with the AI SDK, pretty much the same way it already works images. Here are some key points:

  • Video::of() API, Same idea as images: describe the clip, tweak options, then generate() or queue().
  • Queued generation with callbacks, queue() plus then / catch so long runs don’t block the request.
  • Fakes for tests, Video::fake() and assertions in the same way as image fake can be used.
  • Config hooks, Default video provider and an optional queue name; falls back to the normal default queue when one isn't set in the app.
  • Gateway behind the provider, Video HTTP flow lives on the provider/gateway side which allows apps to keep using the Video entry point.

Code Example:

use Laravel\Ai\Video;

Video::of('A short clip of a city at night with neon lights')
    ->queue(provider: 'openai')
    ->onQueue('process-videos')
    ->then(fn ($response) => $response->storePublicly(path: 'videos', disk: 'public'))
    ->catch(fn (\Throwable $e) => report($e));

Demo:
(Note: The video is a bit jittery thanks to some crop tool I used, I also cut out all the waiting around, it's not actually this quick!)

laravel-ai-sdk-videos.mp4

@edulazaro
Copy link
Copy Markdown

We need this : )

@pushpak1300 pushpak1300 self-assigned this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants