视频就是代码。
场景是组件,支持 Flexbox、Grid 和 Tailwind。剪辑是 JSON,有轨道、转场和关键帧。可以 diff,可以 review,可以重新生成。
Agent 用代码写视频。Valle 负责检查、把画面给它看、再渲染出来:程序化视频,原生渲染,就在你的电脑上。
curl -fsSL https://openvalle.ai/install.sh | sh irm https://openvalle.ai/install.ps1 | iex 然后给 Agent 装上 skill: npx skills add openvalle/valle · 其他安装方式
由 Valle 从五个源文件渲染。点击任意一帧,看它实时播放。
动画是 React 风格的组件,用 Tailwind 写样式。视频剪辑是一份 JSON 时间线。不用操作剪辑软件,也不用拿浏览器截图,只是 AI Agent 能写、能检查、能渲染成 MP4 的文件。
export const composition = {
width: 1920, height: 1080, fps: 30, duration: 3,
};
export default function Title() {
const { seconds } = useCurrentTime();
const shown = interpolate(seconds, [0, 0.8], [0, 1], {
easing: "easeOutExpo",
});
return (
<View className="grid size-full place-items-center
bg-linear-to-br from-indigo-600 to-fuchsia-500">
<Text className="text-9xl font-black text-white"
style={{ opacity: shown }}>
Hello, Valle
</Text>
</View>
);
}
{
"canvas": { "width": 1920, "height": 1080, "fps": 30 },
"resources": {
"title": "title.motion.tsx",
"clip": "clip.mp4"
},
"tracks": {
"visual": [{
"items": [
{ "id": "title", "kind": "motion",
"component": "title", "duration": 2 },
{ "transition": "fade",
"inOffset": 0.4, "outOffset": 0.4 },
{ "id": "shot", "kind": "video", "src": "clip",
"trimStart": 0.5, "duration": 2.5 }
]
}]
}
} $ valle timeline check edit.timeline.json
135 frames, no problems
$ valle timeline render edit.timeline.json --storyboard -o sheet.png
12 frames drawn into sheet.png
$ valle timeline render edit.timeline.json -o edit.mp4
135 frames encoded into edit.mp4 in 1.5 s 场景是组件,支持 Flexbox、Grid 和 Tailwind。剪辑是 JSON,有轨道、转场和关键帧。可以 diff,可以 review,可以重新生成。
Agent 看不了视频,所以 Valle 把画面交给它:任意一帧导出成 PNG,或者把很多帧排成一张故事板。出了错,check 会指出是哪一行,以及应该怎么写。
$ valle motion check title.motion.tsx --json
{
"status": "error",
"message": "1 problem in 90 frames",
"problems": [{
"message": "title.motion.tsx:11:5: HTML tags are not supported: use <View> instead of <div>",
"first": 0, "count": 90
}]
} 每一帧都由 Valle 自己用 Rust 写的引擎在 GPU 上绘制。没有无头 Chrome,没有截图。同样的输入,每次都得到同样的画面。
命令行、渲染器和 Studio(让人旁观和调整 Agent 作品的编辑器)都在一个可执行文件里。不需要云服务,不需要注册账号。
每一段都只有一个动画代码文件。在浏览器里打开,Valle 会实时渲染它们,用的是编译成 WebAssembly 的同一个引擎。
一条命令:下载一个可执行文件,校验后放进 PATH。
curl -fsSL https://openvalle.ai/install.sh | sh irm https://openvalle.ai/install.ps1 | iex 渲染视频需要它。只出图形和单帧的话不需要。
brew install ffmpeg Linux 和 Windows → 然后让它做视频。Agent 会写文件、检查、看画面、渲染。
npx skills add openvalle/valle “给我们的 App 做一个 10 秒的发布视频。” 或者手动下载 v0.1.4: macOS Apple silicon · macOS Intel · Linux x86_64 · Linux arm64 · Windows x86_64 · Windows arm64