Skip to content

Video Support#305

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

Video Support#305
JonPurvis wants to merge 5 commits into
laravel: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
@JonPurvis

Copy link
Copy Markdown
Author

Hey @pushpak1300

Want me to sort the conflict on this branch?

@pushpak1300

Copy link
Copy Markdown
Member

Hey @JonPurvis I'll hold on for this as we will be doing some internal refactoring on all providers. Once that is done it will be very simple to do the refactoring.

@JonPurvis

Copy link
Copy Markdown
Author

No problem @pushpak1300 - looking forward to seeing all the updates!

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