Skip to main content

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:
  1. Text to video - Generate video from text prompt
  2. Image to video - Animate a static image (with optional text prompt)
  3. Image to video with interpolation - Generate video between two frames
  4. 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 a GenerateVideosOperation 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 source parameter instead of deprecated prompt, image, video parameters
  • 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_prompt feature can improve results but may alter your intent