The collaborative AI Gen TV

November 2025 · Updated September 2026

Live Stream Replay

A live TV channel programmed by its audience. Viewers of a YouTube stream donate with a prompt, AI agents check it and turn it into a video with Google's Veo, and a few minutes later it plays live on stream with the donor's name.

Inspiration

Inspired by Google's AI Flow, the hype around generative AI video, and interactive streaming. The goal is entertainment: bring people together for a fun, surprising show where nobody knows what comes next. Along the way it shows what AI video generation can do, and playfully teaches viewers how to write a good video prompt, because they see their own words come to life (or get rewritten).

What it does

A generated video playing live on stream with the donor's name and prompt

From the viewer's side, it's five steps:

  1. Donatewith a video idea as the message
  2. ModerateAI checks the prompt, rewrites it if needed
  3. GenerateVeo turns it into a video
  4. Storethe video lands in a cloud bucket
  5. Broadcastit plays live with name and prompt

The newest video always plays first. When it ends, the stream falls back to a random replay of videos generated earlier in the session, so the channel never goes quiet.

How it works

The whole system in one picture: two entry points feed a single agent service on Google Cloud, and the streaming PC picks up whatever it produces.

1. Keeping the stream family-friendly

Anyone can type anything into a donation, and it goes out live. So every prompt is first checked by the Cloud Natural Language API, which scores it for toxicity. A Gemini agent then decides what to do with it. Rather than just rejecting prompts, it rewrites them, so every donor still gets a video:

SAFE

The prompt is used exactly as written.

A cat surfing a giant wave at sunset
BORDERLINE

Rewritten to be family-friendly, and marked "censored" on screen.

Two knights in a bloody sword fight
Two valiant knights engaged in a heroic and honorable sword duel, their armor gleaming in the sunlight
TOXIC

Replaced entirely by an invented prompt that is meant to be spectacular or funny.

Shown as "prompt banned, replacement prompt here: …"

Real input and output from a test run of the pipeline.

2. Generating the video

The video worker agent calls Veo through the Vertex AI API and saves the result to a Google Cloud Storage bucket, together with the text to show on screen. The donation amount chooses the model:

$2 – $5Veo Fast: quicker and cheaper
Over $5Veo standard: higher quality

A final agent confirms whether the whole workflow succeeded or failed, so the caller always gets a clear answer.

3. From donation to agent

My YouTube channel was too new for native donations, so I used StreamElements. A local bot (Streamlabs Chatbot) on my PC catches each donation, checks the amount, fetches a GCP identity token, and starts a small C# program. That program builds the request (prompt, quality, donor name) and makes the authenticated call to Cloud Run. The agent service is private, so only callers with a valid identity can use it.

For the hackathon jury I also built a web app, a second Cloud Run service, so they could try it without the stream. Users sign in with Google and request access. I approve them by hand, and each approved account gets a small number of generations. Finished videos are shared back through a time-limited signed link.

4. On the streaming PC

OBS scene capturing the FFmpeg video player and the prompt text

A Python program watches the bucket. When a new video and its prompt file appear, it downloads them, plays the video with FFmpeg, and writes the prompt into a local prompt.txt. When the video ends, it picks a random earlier video from a local SQL database and keeps the replay loop going.

OBS captures two sources, the FFmpeg window and prompt.txt, and broadcasts the combined scene to YouTube Live.

2026 update: new models and cost safeguards

Coming back to the project a year later, I upgraded it to the latest models: Gemini 3 for the agents and the stable Veo 3.1 release for video. One surprise: the new Gemini models are only served from Google's global endpoint, while Veo and the storage bucket stay in us-central1, so the two now have separate location settings.

The bigger lesson was about cost. Every Veo video is billed per second, and Google Cloud budget alerts can arrive hours after the spending happens. An alert can tell you what you already spent, but it can't stop the spending. So I added limits that are checked before every paid call:

Daily capA counter in Firestore, updated in a transaction, limits how many videos can be made per day across all users and entry points.
One video per requestIf an agent gets stuck in a loop and calls Veo again, the extra calls are refused.
Kill switchOne setting turns off all video generation.
Fail closedIf the limit can't be checked, no video is made. Per-user limits are also reserved before generating, so sending many requests at once can't bypass them.

Tech stack

Google ADKGemini 3Veo 3.1Vertex AI Cloud RunCloud StorageFirestore Cloud Natural Language APIPython / FastAPIC# FFmpegOBSStreamElements

Source code