Table of Contents

Class GenerateVideosConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Configuration for generating videos.

public record GenerateVideosConfig : IEquatable<GenerateVideosConfig>
Inheritance
GenerateVideosConfig
Implements
Inherited Members

Properties

AspectRatio

The aspect ratio for the generated video. 16:9 (landscape) and 9:16 (portrait) are supported.

[JsonPropertyName("aspectRatio")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? AspectRatio { get; set; }

Property Value

string

CompressionQuality

Compression quality of the generated videos.

[JsonPropertyName("compressionQuality")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public VideoCompressionQuality? CompressionQuality { get; set; }

Property Value

VideoCompressionQuality?

DurationSeconds

Duration of the clip for video generation in seconds.

[JsonPropertyName("durationSeconds")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? DurationSeconds { get; set; }

Property Value

int?

EnhancePrompt

Whether to use the prompt rewriting logic.

[JsonPropertyName("enhancePrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EnhancePrompt { get; set; }

Property Value

bool?

Fps

Frames per second for video generation.

[JsonPropertyName("fps")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Fps { get; set; }

Property Value

int?

GenerateAudio

Whether to generate audio along with the video.

[JsonPropertyName("generateAudio")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? GenerateAudio { get; set; }

Property Value

bool?

HttpOptions

Used to override HTTP request options.

[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }

Property Value

HttpOptions

Labels

User specified labels to track billing usage.

[JsonPropertyName("labels")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

LastFrame

Image to use as the last frame of generated videos. Only supported for image to video use cases.

[JsonPropertyName("lastFrame")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Image? LastFrame { get; set; }

Property Value

Image

Mask

The mask to use for generating videos.

[JsonPropertyName("mask")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public VideoGenerationMask? Mask { get; set; }

Property Value

VideoGenerationMask

NegativePrompt

Explicitly state what should not be included in the generated videos.

[JsonPropertyName("negativePrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NegativePrompt { get; set; }

Property Value

string

NumberOfVideos

Number of output videos.

[JsonPropertyName("numberOfVideos")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? NumberOfVideos { get; set; }

Property Value

int?

OutputGcsUri

The gcs bucket where to save the generated videos.

[JsonPropertyName("outputGcsUri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? OutputGcsUri { get; set; }

Property Value

string

PersonGeneration

Whether allow to generate person videos, and restrict to specific ages. Supported values are: dont_allow, allow_adult.

[JsonPropertyName("personGeneration")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? PersonGeneration { get; set; }

Property Value

string

PubsubTopic

The pubsub topic where to publish the video generation progress.

[JsonPropertyName("pubsubTopic")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? PubsubTopic { get; set; }

Property Value

string

ReferenceImages

The images to use as the references to generate the videos. If this field is provided, the text prompt field must also be provided. The image, video, or last_frame field are not supported. Each image must be associated with a type. Veo 2 supports up to 3 asset images or 1 style image.

[JsonPropertyName("referenceImages")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<VideoGenerationReferenceImage>? ReferenceImages { get; set; }

Property Value

List<VideoGenerationReferenceImage>

ResizeMode

Resize mode of the image input for video generation.

[JsonPropertyName("resizeMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ImageResizeMode? ResizeMode { get; set; }

Property Value

ImageResizeMode?

Resolution

The resolution for the generated video. 720p and 1080p are supported.

[JsonPropertyName("resolution")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Resolution { get; set; }

Property Value

string

Seed

The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result.

[JsonPropertyName("seed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Seed { get; set; }

Property Value

int?

WebhookConfig

Webhook configuration for receiving notifications when the video generation operation completes.

[JsonPropertyName("webhookConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public WebhookConfig? WebhookConfig { get; set; }

Property Value

WebhookConfig

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GenerateVideosConfig object.

public static GenerateVideosConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GenerateVideosConfig

The deserialized GenerateVideosConfig object, or null if deserialization fails.