xiaohongshu
xiaohongshu
gemini-video
Invoke Google Gemini for video understanding and analysis using the Python google-genai SDK. Supports gemini-3-pro-preview and gemini-2.5-flash for video analysis, transcription, and content extraction.
Full skill instructions
Invoke Google Gemini models for video understanding, analysis, transcription, and content extraction using the Python google-genai SDK.
| Model ID | Description | Best For |
|---|---|---|
gemini-3-pro-preview | Best multimodal understanding | Complex video analysis, detailed descriptions |
gemini-2.5-pro | Advanced reasoning | Deep video analysis with reasoning |
gemini-2.5-flash | Fast processing | Quick video summaries, high throughput |
API Key: Use environment variable GEMINI_API_KEY
For local video files, use the File API to upload first:
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
# Upload video file
video_file = client.files.upload(file='VIDEO_PATH')
print(f'Uploaded file: {video_file.name}')
# Wait for processing
while video_file.state.name == 'PROCESSING':
print('Processing video...')
time.sleep(5)
video_file = client.files.get(name=video_file.name)
if video_file.state.name == 'FAILED':
raise ValueError('Video processing failed')
# Analyze video
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='Describe what happens in this video'),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
# For publicly accessible video URLs
video_url = 'VIDEO_URL_HERE'
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='Analyze this video and provide a detailed summary'),
types.Part(file_data=types.FileData(file_uri=video_url, mime_type='video/mp4'))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
# Upload video
video_file = client.files.upload(file='VIDEO_PATH')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
# Transcribe
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='Transcribe all spoken words in this video. Include timestamps if possible.'),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
When this skill is invoked:
Determine the task type:
Prepare the video:
Select the appropriate model:
gemini-3-pro-previewgemini-2.5-flashExecute and return results
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
video_file = client.files.upload(file='meeting_recording.mp4')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='''Summarize this meeting recording:
1. List all participants mentioned
2. Key discussion points
3. Action items and decisions made
4. Any deadlines mentioned'''),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
video_file = client.files.upload(file='tutorial.mp4')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='''Analyze this tutorial video and create:
1. A step-by-step guide based on the content
2. Key concepts explained
3. Any tips or best practices mentioned
4. Prerequisites needed to follow along'''),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
video_file = client.files.upload(file='coding_session.mp4')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='''Extract all code shown in this video:
1. Identify the programming language
2. Capture the complete code snippets
3. Note any explanations given for the code
4. List any libraries or dependencies mentioned'''),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
video_file = client.files.upload(file='presentation.mp4')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='''Create a timestamped outline of this video:
Format: [MM:SS] - Topic/Event
Include major topic changes, key points, and notable moments.'''),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
from google.genai import types
import time
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
video_file = client.files.upload(file='lecture.mp4')
while video_file.state.name == 'PROCESSING':
time.sleep(5)
video_file = client.files.get(name=video_file.name)
response = client.models.generate_content(
model='gemini-3-pro-preview',
contents=[
types.Content(parts=[
types.Part(text='YOUR_QUESTION_ABOUT_VIDEO_HERE'),
types.Part(file_data=types.FileData(file_uri=video_file.uri, mime_type=video_file.mime_type))
])
]
)
print(response.text)
"
python -c "
from google import genai
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
for f in client.files.list():
print(f'{f.name}: {f.state.name} ({f.mime_type})')
"
python -c "
from google import genai
client = genai.Client(api_key=os.environ.get('GEMINI_API_KEY'))
client.files.delete(name='files/FILE_ID_HERE')
print('File deleted')
"
video/mp4)video/quicktime)video/x-msvideo)video/x-flv)video/x-matroska)video/webm)video/x-ms-wmv)video/3gpp)Common errors and solutions:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience