Communitygithub.com

浏览器视频录制

通过 Codex 内置浏览器捕获截图,生成 60fps、4:3、4K 画质的抛光屏幕录制风格视频,包含自然 macOS 光标、刻意点击编排、缩放跟随构图与 ffprobe/缩略图验证,并支持原生录制 MCP 兼容性检查。

浏览器视频录制 是什么?

该技能用于从 Codex 内置浏览器捕获的屏幕截图中生成高质量、类似真实屏幕录制的视频。它分为三个层次:浏览器控制与截图捕获(通过浏览器 MCP/技能)、本地 Python 渲染流水线(将截图合成为 MP4 视频,添加自然的 macOS 光标、微妙的点击缩放反馈和从容的缩放跟随效果),以及可选的系统原生录制 MCP 集成。渲染流水线使用 `scripts/render_browser_demo.py`,依赖 `python3`、`Pillow`、`ffmpeg` 和 `ffprobe`,在无 MCP 依赖下即可产生 60fps、3840×2880(4K 4:3)视频。光标默认提取自 macOS 合成器(或使用备用透明 PNG 资源),并支持配置缩放、点击动画和旋转强度。技能特别强调浏览器视口裁剪(避免桌面内容)、刻意光标路径(不游走无关 UI)以及通过 ffprobe 元数据和缩略图抽取验证最终输出质量。这套方案适用于制作 Dribbble 灵感、UI 演示或产品功能介绍的录屏,无需额外屏幕录制软件。

兼容平台~Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/MengTo/Skills/tree/HEAD/agent-skills/codex/browser-video-recording

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

浏览器视频录制 是做什么的?

依赖模型

将工作流分为三个层次:

  1. 浏览器控制与源帧:通过 Browser 技能/MCP 使用 Codex 内置浏览器。如果用户要求使用 Codex 浏览器或项目指明不要使用 Chrome,则不要使用 Chrome。浏览器层提供真实的截图和真实的点击/滚动/导航状态。
  2. 本地视频渲染器:使用捆绑的 Python 脚本将截图渲染为带有自然 macOS 光标、微妙点击缩放和从容缩放跟随构图的 MP4 视频。这不需要屏幕录制 MCP。
  3. 可选的原生录制器集成:仅在原生录制 MCP 可调用且明确用于启动/停止实际应用录制或打开生成的项目时才使用它。如果不可用、被阻止或无法捕获 Codex 浏览器表面,则回退到截图到视频渲染器并解释回退原因。

自包含执行

本技能足以让另一个 Codex 实例执行 Python 渲染,前提是完整安装了技能文件夹,包括 scripts/render_browser_demo.py。Codex 应运行捆绑的脚本,而不是重新创建渲染器。

本地必需工具:

  • python3
  • Python 包 Pillow
  • ffmpeg 和 ffprobe

可选 macOS 光标提取使用 swift 和 /usr/sbin/screencapture。如果这些不可用,请通过 cursor_asset 提供透明 PNG,并在配置中设置 cursor_hotspot。

仍需要 Browser 技能/MCP 来获取最新的 Codex 内置浏览器截图。如果不可用,请使用可用的最佳浏览器自动化截图源并说明回退情况。

可选的原生录制器支持

对于原生应用录制,请验证 MCP 是否支持:

  • 使用 frameRate: 60。
  • 使用 resolutionRawValue: "4K"。
  • 对于区域录制,使用 ratioPresetRawValue: "4:3"。
  • 在裁剪到嵌入式浏览器视口时,使用显式的 selectedRegionOnScreen。

对于本地渲染器,4K 4:3 意味着 3840x2880。如果原生录制器暴露了一个 4K 枚举,则将其视为应用端分辨率预设,并在通过该 MCP 录制时与 4:3 区域选择配对。

捕获工作流

首先使用 browser:control-in-app-browser。加载其文档后,通过 Node/browser API 驱动内置浏览器:

  • 将视口设置为 1920x1440 以获得 4:3 4K 输出,然后在完成后重置它。
  • 导航到请求的页面并执行实际的点击、后退、搜索和滚动。
  • 在每个重要状态更改后保存仅限浏览器的截图。使用类似 01-results-top.png、02-after-card-click.png、03-back-results.png 的名称。
  • 记录每个点击/滚动目标的视口坐标。最终光标路径应落在这些点上,稍作停留,点击,然后移动到下一个有意义的点。

除非用户明确需要系统 UI,否则避免桌面坐标自动化。Codex 浏览器的可见性可能不会暴露可捕获的 macOS 表面;来自浏览器 API 的截图是可靠的来源。

运动规则

让光标感觉有目的性:

  • 使用稀疏、几乎是笔直的光标路径。
  • 在点击目标前短暂停留。
  • 不要在无关的 UI 上徘徊。
  • 让页面过渡在点击后发生,而不是在之前。
  • 仅使用微妙的点击反馈:缩放下降/反弹,除非用户要求,否则不要使用装饰性环形。
  • 保持缩放跟随比光标更从容。相机应框住所点击的内容,而不是追逐每一次微小的鼠标移动。

默认视觉目标:

  • 从合成器提取的真实 macOS 指针,或现有的透明光标资源。
  • 光标缩放 3.0,匹配常用于编辑过的演示录制的大光标样式。
  • 点击动画强度 15,以获得微妙的点击缩放下降效果。
  • 旋转强度最高 8deg,仅来自水平速度。

渲染脚本

使用 scripts/render_browser_demo.py 生成确定的 60fps 4:3 4K 输出:

python3 /path/to/browser-video-recording/scripts/render_browser_demo.py \
  --config /tmp/browser-demo-config.json \
  --output /tmp/browser-demo-4x3-4k-60fps.mp4

生成起始配置:

python3 /path/to/browser-video-recording/scripts/render_browser_demo.py --write-template

配置提供:

  • shots:状态名称到截图 PNG 路径的映射。
  • scene_starts:[time, shotName, transition] 条目。
  • cursor_keys:[time, x, y] 视口坐标条目。
  • camera_keys:[time, x, y, zoom] 条目。
  • click_times:点击时间戳。
  • duration、fps、output_size、source_size、cursor_scale。

首选默认值:

{
  "fps": 60,
  "output_size": [3840, 2880],
  "source_size": [1920, 1440]
}

如果省略了 cursor_asset,脚本会短暂显示一个纯色叠加层,并使用 screencapture 将真实的当前 macOS 光标提取为透明 PNG。这是本地渲染支持,不是 MCP 依赖。

验证

始终验证交付的视频:

ffprobe -v error \
  -show_entries stream=codec_name,width,height,r_frame_rate \
  -show_entries format=duration,size \
  -of json /path/to/output.mp4

提取至少一张视频中段缩略图并检查:

ffmpeg -y -ss 8 -i /path/to/output.mp4 -frames:v 1 -update 1 /tmp/browser-demo-thumb.png

确认:

  • 分辨率是请求的输出,通常是 4:3 4K 的 3840x2880。
  • 帧率是 60/1 或同等值。
  • 时长符合要求。
  • 光标可见、自然且对准目标。
  • 视频裁剪到浏览器内容,而不是桌面。
  • 浏览器视口覆盖已被重置。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

MengTo/Skills

Generate ElevenLabs text-to-speech audio from scripts or inline text using local voice profiles. Use when the user asks for ElevenLabs, text-to-speech, TTS, narration, voiceover, speech audio, or voice generation; load voice names, voice ids, emails, owners, and account-specific defaults only from local config outside the skill.

MengTo/Skills

Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to make animations performant, pause offscreen animations, look for memory leaks, profile pages that slow the computer over time, fix janky scrolling, reduce CPU/GPU use, or repeat the "only play in view" optimization on React/Vite/Next/frontend pages using Codex Browser.

MengTo/Skills

Turn a reference video into a super detailed recreation or inspiration prompt. Use when the user provides, mentions, uploads, links, or points to a video and asks to analyze the design, UI, animations, transitions, scroll interactions, typography, colors, assets, WebGL/Three.js, storytelling, section-by-section behavior, or to create a prompt/article that recreates the page, app, interaction, or motion system.

MengTo/Skills

Create an on-scroll animation trigger using IntersectionObserver with Tailwind-friendly animation classes and keyframes. Use when asked for scroll-reveal, animate-on-scroll, or sequencing element animations when they enter the viewport.

MengTo/Skills

Use when designing or implementing product-grade web motion like Stripe, Linear, Apple, and Vercel. Covers motion principles, easing/duration defaults, choreography patterns, scroll/hover interactions, performance, accessibility (reduced motion), and implementation guidance.

MengTo/Skills

Create premium cinematic web motion systems with GSAP, ScrollTrigger, and Lenis. Use for luxury editorial websites, creative studio portfolios, Awwwards-style interactions, smooth scroll reveals, staggered text, parallax, pinned sections, magnetic hover states, custom cursors, and mouse-reactive layered movement.

MengTo/Skills

Create cinematic scroll-driven landing pages with Lenis smooth scrolling, GSAP ScrollTrigger, scroll-linked progression, staggered text reveals, sticky card stacks, parallax backgrounds, scroll-scrubbed transitions, footer reveals, and immersive preloaders. Use when analyzing or building premium editorial scroll experiences, sticky project stacks, kinetic typography, or section-by-section storytelling.

MengTo/Skills

Use when designing or rewriting a high-converting SaaS pricing page (structure, plan design, copywriting, SEO/AEO, FAQs, layout patterns, experiments). Includes checklists, templates, and common pitfalls.

MengTo/Skills

Use when creating or refining WebGL-heavy landing pages and you need to steer toward a specific visual outcome (premium, technical, playful, cinematic) while balancing conversion clarity, performance, and implementation complexity.

相关技能