Method Signature
Description
Generates videos based on input (text, image, or video) using Veo models. This is a long-running operation that returns immediately with an operation object that can be polled for completion. Supported use cases:- Text to video - Generate video from text prompt
- Image to video - Animate a static image (with optional text prompt)
- Image to video with interpolation - Generate video between two frames
- Video extension - Extend an existing video (with optional text prompt)
Parameters
str
required
The Veo model to use for generation.Examples:
'veo-2.0-generate-001''veo-001'
GenerateVideosSource
The input source for video generation (recommended).Note: Use
source instead of the individual prompt, image, video parameters (which are deprecated).str
Text prompt for video generation. Deprecated - use
source.prompt instead.Image
Input image for image-to-video. Deprecated - use
source.image instead.Video
Input video for video extension. Deprecated - use
source.video instead.GenerateVideosConfig
Configuration for video generation.
Response
Returns aGenerateVideosOperation object for long-running operation tracking.
str
The operation name/ID for polling
bool
Whether the operation is complete
dict
Operation metadata including progress information
dict
Error information if the operation failed
GenerateVideosResponse
The result when operation completes successfully.
Code Examples
Text to Video Generation
Image to Video with Configuration
Frame Interpolation (Image to Video)
Video Extension
With Negative Prompt and Safety Controls
Save to Cloud Storage with Audio
With Pub/Sub Notification
Async Usage
Operation Polling
Video generation is a long-running operation. You must poll the operation to check completion:Notes
- Video generation typically takes 3-10 minutes depending on duration and settings
- Use
sourceparameter instead of deprecatedprompt,image,videoparameters - The operation returns immediately; you must poll for completion
- Use Pub/Sub notifications for production systems instead of polling
- Some configuration options are only available on Vertex AI
- Videos may be filtered by Responsible AI systems
- Higher resolution and longer duration increase generation time
- The
enhance_promptfeature can improve results but may alter your intent
Related Methods
- generate_images - Generate images with Imagen