# Video Generation

Generate short videos from text descriptions using Google Veo 3 directly inside your AVCodex agent. Useful for sales reels showing room concepts, training clips for AV technicians, or visual support cards for client proposals.

---

AVCodex agents can generate short videos from text descriptions using Google Veo 3. Users describe what they want, and the agent produces a video with audio, delivered as a playable download card right in the chat.

> **Note:** Video generation is available on all tiers. It uses your organization's Stripe Token Billing balance.

## How It Works

Video generation is asynchronous. Unlike text or image responses that appear immediately, videos take 1-4 minutes to produce. The chat UI keeps the user informed the whole time.

**1. The User Asks for a Video.**

The user describes the video they want in natural language. The agent crafts a detailed prompt (100-150 words) covering subject, action, camera movement, lighting, mood, style, environment, and color palette.

**2. Job Created.**

The agent calls the `generateVideo` tool, which creates a background job and returns a progress indicator inline in the chat.

**3. Progress Updates.**

As the video moves through the pipeline (queued, generating, uploading), real-time WebSocket events update the progress indicator. The user sees the current phase and an estimated time remaining.

**4. Video Ready.**

When the video is complete, a download card replaces the progress indicator. The user can play the video inline or download it.

## Video Parameters

The agent controls these parameters based on the user's request:

| Parameter | Options | Default | Description |
|-----------|---------|---------|-------------|
| **Duration** | 4s, 6s, 8s | 8s | Length of the generated video |
| **Aspect Ratio** | 16:9, 9:16 | 16:9 | Landscape or portrait orientation |
| **Negative Prompt** | Free text | None | Things to avoid in the output |
| **Reference Image** | URL | None | Optional image to guide the visual style or content |

All videos are generated at **1080p resolution** with **audio included**.

> **Tip:** When a user provides a reference image, it can be used as either an "asset" (content to include) or a "style" reference (visual style to match). The agent decides based on context.

## The Generation Pipeline

Behind the scenes, video generation follows a multi-phase pipeline:

1. **Pending**: Job created in the database.
2. **Queued**: Submitted to the Google Veo 3 API via Vertex AI.
3. **Generating**: Veo is rendering the video (longest phase, usually 2-4 minutes).
4. **Uploading**: Finished video is uploaded to secure cloud storage.
5. **Completed**: Video URL is saved and delivered to the user.

If any phase fails, the job is marked failed and the user gets an error. Failed jobs can be retried.

## Example Use Cases

Video generation works well for:

- **Client proposals**: "Create an 8-second clip of a corporate boardroom with dual 98-inch displays, ceiling mics, and a presenter walking to the front."
- **Marketing for AV services**: "Generate a portrait video of a control panel lighting up as a presenter taps 'Start Meeting,' warm office lighting, cinematic."
- **Concept visualization**: "Make a video of a broadcast control room with monitor walls, soft blue lighting, slow pan across the operator desk."
- **Training storyboards**: "Show a field tech walking up to an AV rack, camera tracking from behind, then close-up on a green status LED."
- **Internal recruiting**: "Create a clip of a higher-ed lecture hall full of students with a Crestron-controlled lectern lighting up. Inspiring, golden hour."

### Prompting Tips

The agent automatically crafts detailed prompts, but users get better results with specificity:

- **Good**: "Create a video of a 12-person huddle room: white walls, wood table, Logitech Rally Bar mounted under a single 75-inch display, slow dolly-in, warm afternoon light."
- **Less effective**: "Make a video of a meeting room."

Camera movement (tracking shot, dolly zoom, static), lighting (golden hour, soft office, neon broadcast), and mood (cinematic, technical, calm) all improve output quality.

## Storage and Delivery

Generated videos are stored in Google Cloud Storage under your organization's workspace. Each video gets a unique URL served through the standard file download system with signed URLs. Videos persist as long as the associated chat session exists.

The video appears in the chat as a rich download card, similar to how file attachments are displayed. Users can play it inline or download the MP4.

## Billing

Video generation is billed per video through the `video_generation` usage meter on your Stripe Token Billing balance. Each video counts as one unit regardless of duration or aspect ratio.

> **Warning:** Video generation is more expensive than image generation. The cost reflects the compute required to render 1080p video with audio via Google Veo 3. Monitor your usage in the billing dashboard.

## Limitations

- **Maximum duration is 8 seconds.** Veo 3 only supports short-form video generation.
- **Generation takes 1-4 minutes.** Inherent to the Veo pipeline. It can't be accelerated.
- **Generation may time out** after 6 minutes if the Veo API is under heavy load. The user gets an error and can retry.
- **No video editing.** Unlike image generation, users cannot upload a video and ask for modifications. Each generation is from scratch (though a reference image can guide the output).
- **YouTube URLs are not supported** as reference images. Provide direct image URLs or upload files.

*AVCodex · Your AV expertise. Amplified by AI.*
