跳到主内容
@wquguru
精选88Hacker News Best(web_list)技巧与观点

OpenComputer利用Claude Opus 5.5生成解释视频的工程实践

Opus 5.5 is good at explainer videos

原文
发到 X
推荐理由

Agent开发者的硬核参考:用Opus 5.5写代码而非直接生成视频,通过确定性的渲染管线解决AI视频不可控问题,完整架构值得借鉴。

URLPromptchoose one

URLPrompt选择一个

try an exampleShip it

尝试一个示例Ship it

examples

示例

Made by this page, untouched.

由本页制作,未经修改。

Each one is a single run: a URL or a prompt in, an MP4 out. No edits.

每一次都是单次运行:输入 URL 或提示词,输出 MP4。无需编辑。

0:31

NVIDIA

nvidia.com

use this input →

使用此输入 →

0:34

Jev, by TypeSafe AI

typesafe.ai

use this input →

使用此输入 →

0:33

OpenComputer

opencomputer.dev

use this input →

使用此输入 →

0:34

Linear

linear.app

use this input →

使用此输入 →

0:32

Infera (from a prompt)

Infera (来自提示词)

“make a modern slick and punchy video for a modern startup that works on inference”

“为一个从事推理工作的现代初创公司制作一个现代、流畅且有力的视频”

use this input →

使用此输入 →

how it runs

运行方式

A serverless agent on OpenComputer. Yours in one click.

OpenComputer 上的无服务器代理。一键获取。

The whole product is one agent file, three tools, and this form. OpenComputer runs the agent, the microVM it renders in, the model gateway, and the session API the page polls.

整个产品包含一个代理文件、三个工具和这个表单。OpenComputer 运行代理、其渲染的微虚拟机、模型网关以及页面轮询的会话 API。

Agent

代理

One OpenComputer serverless agent, defined in TypeScript and deployed with opencomputer deploy. No framework, no queue, no server of ours.

一个 OpenComputer 无服务器代理,用 TypeScript 定义并通过 opencomputer deploy 部署。没有框架、没有队列、也没有我们自己的服务器。

Model

模型

anthropic/claude-opus-5.5 through OpenComputer's model gateway. Roughly 90k input and 15k output tokens per film, most of it the HTML itself.

通过 OpenComputer 的模型网关使用 anthropic/claude-opus-5.5。每部影片大约 90k 输入 token 和 15k 输出 token,其中大部分是 HTML 本身。

Runtime

运行时

Every job is one session in a fresh microVM: Amazon Linux 2023 on arm64, 4 vCPU, 8 GB RAM, Node 22. The first tool call installs Playwright's headless Chromium and a static ffmpeg (about a minute); the VM is thrown away after.

每个作业都在全新的 microVM 中作为一个会话运行:基于 arm64 的 Amazon Linux 2023,4 vCPU,8 GB RAM,Node 22。第一个工具调用会安装 Playwright 的无头 Chromium 和静态版 ffmpeg(约一分钟);随后该 VM 会被销毁。

Tools

工具

Three defineTool functions. web_fetch returns page text plus title, headings, the most used hex colors, and Google Fonts. check_scene loads the film and reports JS errors and the visible text at sample timestamps. render_video renders and uploads.

三个 defineTool 函数。web_fetch 返回页面文本以及标题、标题层级、最常用的十六进制颜色和 Google Fonts。check_scene 加载影片并报告 JS 错误以及在采样时间戳处的可见文本。render_video 负责渲染和上传。

Rendering

渲染

No video model. The page's clocks (requestAnimationFrame, timers, Date, CSS and Web Animations) are replaced with a virtual clock, so every frame is a deterministic seek. 1920x1080 at 30 fps, JPEG frames piped into libx264, crf 18.

没有视频模型。页面的时钟(requestAnimationFrame、计时器、Date、CSS 和 Web Animations)被虚拟时钟替换,因此每一帧都是确定性的寻址。分辨率为 1920x1080,30 fps,JPEG 帧通过管道传入 libx264,crf 为 18。

Storage

存储

The agent holds no secrets. The form mints a Vercel Blob upload token scoped to one path for three hours, parks it in a per-job manifest, and the tool fetches it by job id. The finished MP4 is a public Blob URL.

代理不持有敏感信息。表单生成一个 Vercel Blob 上传令牌,限定路径且有效期为三小时,将其放入按作业划分的清单中,工具则通过作业 ID 获取它。完成的 MP4 是一个公共 Blob URL。

Control plane

控制平面

This page uses the same API the CLI does: create a session, send one turn, poll the event stream (tool.started, tool.completed, turn.completed) to show progress, and treat the MP4 appearing in Blob as done.

此页面使用与 CLI 相同的 API:创建会话,发送一轮交互,轮询事件流(tool.started、tool.completed、turn.completed)以显示进度,并将 Blob 中出现 MP4 视为完成。

代码 · 12 行
// opencomputer/agents/director/agent.ts
import { useInput, useModel, useTool } from "@opencomputer/agent";
import { checkScene, renderVideo } from "./tools/scene.js";
import { webFetch } from "./tools/web.js";
export default function Agent() {
  const input = useInput();           // the JOB block from the form
  useModel("anthropic/claude-opus-5.5");
  useTool(webFetch);                  // read the product's site
  useTool(checkScene);                // load the HTML, report errors + visible text
  useTool(renderVideo);               // headless Chromium → ffmpeg → Blob
  return `You are a motion designer who writes code. ...`;
}

Deploy this agent

部署此代理

One click. Free account, the agent lands in your project with its tools and prompt.

一键部署。免费账户即可,代理及其工具和提示词将出现在你的项目中。

Clone the repo

克隆仓库

diggerhq/shipvideo: the agent, the renderer, and this web app.

diggerhq/shipvideo:包含代理、渲染器和这个 Web 应用。

Build your own agent

构建你自己的代理

The quickstart: a TypeScript file, a deploy, a session. Ten minutes.

快速入门:一个 TypeScript 文件、一次部署、一个会话。十分钟搞定。

$npx opencomputer template deploy https://github.com/diggerhq/shipvideocopy

Everything above is in the repo, and one click deploys it to your account. The idea comes from Deedy's post on Opus 5.5 and instructional video: the model writes the film as code, and code renders the same every time.

上述所有内容都在仓库中,一键即可部署到你的账户。这一想法源自 Deedy 关于 Opus 5.5 和指导性视频的帖子:模型将影片作为代码编写,而代码每次渲染的结果都相同。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件