← 返回
数据分析 Key 中文

Meta Video Ad Analyzer

Extract and analyze content from video ads using Gemini Vision AI. Supports frame extraction, OCR text detection, audio transcription, and AI-powered scene analysis. Use when analyzing video creative content, extracting text overlays, or generating scene-by-scene descriptions.
使用Gemini Vision AI提取并分析视频广告内容,支持帧提取、OCR文字检测、音频转录和AI场景分析。适用于分析视频创意、提取文字叠加层或生成逐场景描述。
fortytwode
数据分析 clawhub v1.0.0 1 版本 99948.3 Key: 需要
★ 1
Stars
📥 1,914
下载
💾 104
安装
1
版本
#latest

概述

Video Ad Analyzer

AI-powered video content extraction using Google Gemini Vision.

What This Skill Does

  • Frame Extraction: Smart sampling with scene change detection
  • OCR Text Detection: Extract text overlays using EasyOCR
  • Audio Transcription: Convert speech to text with Google Cloud Speech
  • AI Scene Analysis: Describe each scene using Gemini Vision
  • Native Video Analysis: Direct video understanding for longer content
  • Thumbnail Generation: Auto-generate thumbnails from first frame

Setup

1. Environment Variables

# Required for Gemini Vision
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json

# Required for audio transcription
# (same service account needs Speech-to-Text API enabled)

2. Dependencies

pip install opencv-python pillow easyocr ffmpeg-python google-cloud-speech vertexai google-api-python-client

Also requires ffmpeg and ffprobe installed on system.

Usage

Basic Video Analysis

from scripts.video_extractor import VideoExtractor
from scripts.models import ExtractedVideoContent
import vertexai
from vertexai.generative_models import GenerativeModel

# Initialize Vertex AI
vertexai.init(project="your-project-id", location="us-central1")
gemini_model = GenerativeModel("gemini-1.5-flash")

# Create extractor
extractor = VideoExtractor(gemini_model=gemini_model)

# Analyze video
result = extractor.extract_content("/path/to/video.mp4")

print(f"Duration: {result.duration}s")
print(f"Scenes: {len(result.scene_timeline)}")
print(f"Text overlays: {len(result.text_timeline)}")
print(f"Transcript: {result.transcript[:200]}...")

Extract Only Frames

frames, timestamps, text_timeline, scene_timeline, thumbnail = extractor.extract_smart_frames(
    "/path/to/video.mp4",
    scene_interval=2,    # Check for scene changes every 2s
    text_interval=0.5    # Check for text every 0.5s
)

Analyze Images

# Works with images too
result = extractor.extract_content("/path/to/image.jpg")
print(result.scene_timeline[0]['description'])

Output Structure

ExtractedVideoContent(
    video_path="/path/to/video.mp4",
    duration=30.5,
    transcript="Here's what we found...",
    text_timeline=[
        {"at": 0.0, "text": ["Download Now"]},
        {"at": 5.5, "text": ["50% Off Today"]}
    ],
    scene_timeline=[
        {"timestamp": 0.0, "description": "Woman using phone app..."},
        {"timestamp": 2.0, "description": "Product showcase with features..."}
    ],
    thumbnail_url="/static/thumbnails/video_thumb.jpg",
    extraction_complete=True
)

Key Features

FeatureDescription
----------------------
Scene DetectionHistogram-based change detection (threshold=65)
OCR ConfidenceTiered thresholds (0.5 high, 0.3 low)
AI ProofreadingGemini cleans up OCR errors
Source ReconciliationMerges OCR + Vision text intelligently
Native VideoDirect Gemini analysis for <20MB files

Prompts

Customize AI behavior by editing prompts in the prompts/ folder:

  • scene_analysis.md - Frame analysis prompts
  • scene_reconciliation.md - Scene enrichment prompts

Common Questions This Answers

  • "What text appears in this video ad?"
  • "Describe each scene in this creative"
  • "What does the narrator say?"
  • "Extract the call-to-action from this ad"

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 17:31 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,154
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,012
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,213