# `Gemini.Types.Generation.Video`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L1)

Type definitions for video generation using Google's Veo models.

Veo is Google's advanced text-to-video generation model that creates high-quality
videos from text descriptions. Video generation is a long-running operation that
requires polling to check completion status.

## Supported Models

- `veo-2.0-generate-001` - Veo 2.0 video generation model
- `veo-3.1-generate-preview` - Veo 3.1 preview
- `veo-3.1-fast-generate-preview` - Veo 3.1 Fast preview
- `veo-3.0-generate-001` - Veo 3.0 stable
- `veo-3.0-fast-generate-001` - Veo 3.0 Fast stable

## Example

    config = %VideoGenerationConfig{
      number_of_videos: 1,
      duration_seconds: 8,
      aspect_ratio: "16:9"
    }

    {:ok, operation} = Gemini.APIs.Videos.generate(
      "A cat playing piano in a cozy living room",
      config
    )

    # Wait for completion
    {:ok, completed} = Gemini.APIs.Operations.wait(operation.name)

    # Get video URLs
    videos = completed.response["generatedVideos"]

See `Gemini.APIs.Videos` for API functions.

# `aspect_ratio`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L53)

```elixir
@type aspect_ratio() :: String.t()
```

Aspect ratio for generated videos.

Common aspect ratios:
- `"9:16"` - Vertical/mobile (e.g., 720x1280)
- `"16:9"` - Horizontal/desktop (e.g., 1280x720)
- `"1:1"` - Square (e.g., 1024x1024)

# `compression_format`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L61)

```elixir
@type compression_format() :: :h264 | :h265
```

Video compression format.

- `:h264` - H.264/AVC compression (default, widely compatible)
- `:h265` - H.265/HEVC compression (better quality, smaller size)

# `reference_type`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L79)

```elixir
@type reference_type() :: String.t()
```

Reference image type for video generation.

Common values:
- `"asset"` - Preserve the referenced subject
- `"style"` - Apply visual style

# `resolution`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L70)

```elixir
@type resolution() :: String.t()
```

Resolution for generated videos.

Supported values:
- `"720p"` (default)
- `"1080p"` (up to 8s duration)

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L132)

```elixir
@type t() :: Gemini.Types.Generation.Video.VideoGenerationConfig.t()
```

# `build_generation_params`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L213)

```elixir
@spec build_generation_params(
  String.t(),
  Gemini.Types.Generation.Video.VideoGenerationConfig.t()
) ::
  map()
```

Builds parameters map for video generation API request.

# `complete?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L338)

```elixir
@spec complete?(Gemini.Types.Generation.Video.VideoOperation.t()) :: boolean()
```

Checks if a video operation is complete.

# `extract_videos`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L363)

```elixir
@spec extract_videos(Gemini.Types.Operation.t()) ::
  {:ok, [Gemini.Types.Generation.Video.GeneratedVideo.t()]} | {:error, term()}
```

Extracts generated videos from a completed operation.

# `failed?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L354)

```elixir
@spec failed?(Gemini.Types.Generation.Video.VideoOperation.t()) :: boolean()
```

Checks if a video operation failed.

# `format_compression_format`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L188)

```elixir
@spec format_compression_format(compression_format()) :: String.t()
```

Converts compression format to API format.

## Examples

    iex> format_compression_format(:h264)
    "h264"

# `format_person_generation`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L204)

```elixir
@spec format_person_generation(atom()) :: String.t()
```

Converts person generation policy to API format.

# `format_safety_filter_level`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L195)

```elixir
@spec format_safety_filter_level(atom()) :: String.t()
```

Converts safety filter level to API format.

# `parse_generated_video`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L306)

```elixir
@spec parse_generated_video(map()) :: Gemini.Types.Generation.Video.GeneratedVideo.t()
```

Parses a generated video from API response.

# `succeeded?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L346)

```elixir
@spec succeeded?(Gemini.Types.Generation.Video.VideoOperation.t()) :: boolean()
```

Checks if a video operation succeeded.

# `wrap_operation`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/generation/video.ex#L324)

```elixir
@spec wrap_operation(Gemini.Types.Operation.t()) ::
  Gemini.Types.Generation.Video.VideoOperation.t()
```

Wraps an Operation with video-specific metadata.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
