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.
使用Google Gemini Vision实现AI驱动的视频内容提取。
bash
bash
pip install opencv-python pillow easyocr ffmpeg-python google-cloud-speech vertexai google-api-python-client
还需在系统上安装ffmpeg和ffprobe。
python
from scripts.video_extractor import VideoExtractor
from scripts.models import ExtractedVideoContent
import vertexai
from vertexai.generative_models import GenerativeModel
print(f时长: {result.duration}秒)
print(f场景数: {len(result.scene_timeline)})
print(f文本叠加层数: {len(result.text_timeline)})
print(f转录文本: {result.transcript[:200]}...)
python
frames, timestamps, texttimeline, scenetimeline, thumbnail = extractor.extractsmartframes(
/path/to/video.mp4,
scene_interval=2, # 每2秒检查场景变化
text_interval=0.5 # 每0.5秒检查文本
)
python
python
ExtractedVideoContent(
video_path=/path/to/video.mp4,
duration=30.5,
transcript=这是我们发现的内容...,
text_timeline=[
{at: 0.0, text: [立即下载]},
{at: 5.5, text: [今日五折优惠]}
],
scene_timeline=[
{timestamp: 0.0, description: 女性正在使用手机应用...},
{timestamp: 2.0, description: 产品展示,包含功能特点...}
],
thumbnailurl=/static/thumbnails/videothumb.jpg,
extraction_complete=True
)
| 特性 | 描述 |
|---|---|
| 场景检测 | 基于直方图的变化检测(阈值=65) |
| OCR置信度 |
通过编辑prompts/文件夹中的提示词来自定义AI行为:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 meta-video-ad-analyzer-1776364708 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 meta-video-ad-analyzer-1776364708 技能
skillhub install meta-video-ad-analyzer-1776364708
文件大小: 14.66 KB | 发布时间: 2026-4-17 14:28