GEMINI LABJP
FLASH35 — Gemini 3.5 Flash is now GA and powers gemini-flash-latest, making everyday generation faster and more affordableAGENTS — Managed Agents launch in public preview in the Gemini API, running in secure, isolated Google-hosted Linux sandboxesMEDIA — Nano Banana 2 Lite and Gemini Omni Flash bring faster image and high-quality video generation across AI Studio and the APITTS — Streaming speech generation is now supported for gemini-3.1-flash-tts-preview via streamGenerateContentTRANSLATE — A new audio model detects 70+ languages for live speech-to-speech translation while preserving natural intonationSPENDCAP — Project-level spend caps for billing have been added in Google AI Studio to keep costs under controlFLASH35 — Gemini 3.5 Flash is now GA and powers gemini-flash-latest, making everyday generation faster and more affordableAGENTS — Managed Agents launch in public preview in the Gemini API, running in secure, isolated Google-hosted Linux sandboxesMEDIA — Nano Banana 2 Lite and Gemini Omni Flash bring faster image and high-quality video generation across AI Studio and the APITTS — Streaming speech generation is now supported for gemini-3.1-flash-tts-preview via streamGenerateContentTRANSLATE — A new audio model detects 70+ languages for live speech-to-speech translation while preserving natural intonationSPENDCAP — Project-level spend caps for billing have been added in Google AI Studio to keep costs under control
Articles/API / SDK
API / SDK/2026-07-07Advanced

Extract Social Media Promo Metadata From Short Videos in One Omni Flash Pass

Hand a short clip to the public preview of Gemini Omni Flash once and get captions, chapters, and highlight timestamps back as structured JSON. Covers how this differs from a frame-extraction multi-call setup, where fps and media_resolution actually matter, and a per-clip cost estimate — from the angle of keeping an indie promo workflow moving.

gemini102omni-flashmultimodal43video5structured-output22

Premium Article

Every time I finish a new short video, the thing that stalls me is not the video itself — it is writing the announcement copy for it. Watching a 30-second clip over and over, noting the seconds where the good moments land, drafting a caption and hashtags. As an indie developer at Dolice, this stretch has always been the bottleneck.

With Omni Flash in public preview, that hand transcription collapses into a single API call. Instead of slicing the video into frames and sending them one by one, you hand the model the video natively and get the promo elements back as structured JSON. Here is the minimal setup, with working code and a cost estimate you can reuse.

Choosing not to slice into frames

The classic approach to video understanding was to pull a frame every few seconds with ffmpeg and send each still image separately. It is stable, but the motion between the sampled instants is lost, and every extra call turns directly into cost and latency.

Omni Flash takes one whole video natively and interprets it with the timeline intact. Where exactly to let go of frame extraction is something I worked through, measurements included, in folding video understanding into a single Omni Flash pass. This article picks up after that: turning the single-pass understanding into structured data you can actually publish with.

Promo metadata is, in fact, one of the better fits for Omni Flash within video work — because the shape of the output is decided up front. Caption, hashtags, chapters, highlight timestamps. When you can fix the output shape in advance, the most stable move is to stop the model from writing freely and pour its answer into a schema.

Decide the output shape first

Declare the JSON you want with Pydantic. Leave this vague and the model returns a different structure every run, and your downstream parsing breaks.

from pydantic import BaseModel
 
class Chapter(BaseModel):
    start: str   # mm:ss like "0:07"
    title: str   # a short heading for the chapter
 
class Highlight(BaseModel):
    timestamp: str  # the good moment, "0:12"
    reason: str     # why this is a highlight
 
class PromoMeta(BaseModel):
    hook_caption: str        # the short hook for the first line
    long_caption: str        # a slightly longer body caption
    hashtags: list[str]      # expect 5 to 8
    chapters: list[Chapter]  # the flow of the video
    highlights: list[Highlight]  # candidates for thumbnails or cutdowns

The key is that timestamp is a mm:ss string, not a number. Ask the model to turn video time into a number and the unit wobbles between seconds and frames. Take it in the form you will display, and convert to seconds later if you need to.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
If you have been hand-writing promo copy from every clip, you can now get a first draft back from a single API call
You will get a working design for pulling captions, chapters, and highlight timestamps as a typed object, with copy-paste code
You can decide how far to cut fps and media_resolution before accuracy breaks, and map a per-clip cost estimate onto your own workflow
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API / SDK2026-07-13
When responseSchema Can't Do $ref: Handling Recursive Schemas in Production with responseJsonSchema
Gemini's responseSchema is an OpenAPI subset with no $ref or $defs, so it can't express shared definitions or recursion. Here's how I moved to responseJsonSchema to reuse localized fields and handle a recursive category tree in production.
API / SDK2026-06-23
Generating a Thumbnail From a Video With Nano Banana 2 (gemini-3.1-flash-image)
A hands-on guide to passing a whole video as context to the GA model gemini-3.1-flash-image (Nano Banana 2) and generating a single thumbnail. Covers how it differs from frame extraction, the preview-to-GA migration, and measured cost and time per image.
API / SDK2026-05-18
Building Automatic Wallpaper Category Classification with Gemini Vision
An indie developer shares how they implemented automatic wallpaper image classification with the Gemini Vision API — including accuracy results, real pitfalls, structured-output tips, and a cost comparison with GPT-4o Vision.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →