# Oak Video Editor Project File Reference / Oak 视频编辑器项目文件格式参考
This document describes Oak Video Editor's XML project format (`.ove`) as implemented in the current codebase. It is intended to be detailed enough to implement a compatible reader/writer.
本文件描述 Oak 视频编辑器当前代码库实现的 XML 项目格式(`.ove`),详细程度足以支持兼容的读写实现。
> Source of truth / 权威源码:`app/node/project.cpp`, `app/node/node.cpp`, `app/node/value.*`, `app/node/keyframe.*`, `app/node/project/serializer/*`, `app/node/project/footage/footage.cpp`, `app/node/output/viewer/viewer.cpp`, `app/node/output/track/track.cpp`, `app/node/group/group.cpp`, `app/window/mainwindow/mainwindowlayoutinfo.cpp`.
---
## 1. Root Document / 根文档
```xml
...
```
- `version`: serializer version in `YYMMDD` format. The latest serializer is `230220` (`ProjectSerializer230220`).
- `version`:序列化器版本,格式为 `YYMMDD`。当前最新为 `230220`(`ProjectSerializer230220`)。
- `url`: optional source path.
- `url`:可选的源文件路径。
---
## 2. Project Container / 项目容器
For full saves, the serializer writes a project container:
完整保存时,序列化器会写入一个项目容器:
```xml
......
```
See `ProjectSerializer230220::Save()` and `Load()` in `app/node/project/serializer/serializer230220.cpp`.
---
## 3. Project Data (`Project::Save` / `Project::Load`) / 项目数据
```xml
............
```
### 3.1 `uuid`
- QUuid string identifying the project.
- 项目 UUID 字符串。
### 3.2 `plugins` / 插件列表
List of OpenFX plugins referenced by nodes. This block is loaded **before** `` so that plugin nodes can be registered.
列出节点引用的 OpenFX 插件。该块在 `` 之前加载,以便注册插件节点。
```xml
```
Attributes / 属性:
- `id`: OFX plugin identifier (matches node `id`).
- OFX 插件标识符(与节点 `id` 一致)。
- `major` / `minor`: OFX plugin version.
- OFX 插件版本。
- `bundle`: bundle directory path (preferred).
- 包目录路径(优先使用)。
- `file`: plugin binary path (fallback).
- 插件二进制路径(回退)。
Loading behavior / 加载行为:
- If `` exists, each `bundle` (or `file` if `bundle` is empty) is added to the OFX plugin path, the cache scans the paths, and plugin nodes are registered before `` is parsed.
- 如果存在 ``,则把每个 `bundle`(若 `bundle` 为空则使用 `file`)加入 OFX 插件路径,扫描缓存,并在解析 `` 前注册插件节点。
### 3.3 `nodes` / 节点图
The node graph. Each `` is written by `Node::Save()` and read by `Node::Load()`.
节点图。每个 `` 由 `Node::Save()` 写入、`Node::Load()` 读取。
```xml
3
...
..................
```
Attributes / 属性:
- `id`: node type identifier. For OpenFX nodes, this equals the OFX plugin identifier.
- 节点类型标识符。对于 OpenFX 节点,等于 OFX 插件标识符。
- `ptr`: numeric pointer ID used to resolve connections and context positions.
- 数字指针 ID,用于解析连接和上下文位置。
- `version`: currently `1`.
- 当前为 `1`。
### 3.4 `settings` / 项目设置
Project settings stored as key/value text elements.
以键值文本元素保存的项目设置。
Known keys / 已知键:
- `cachesetting`
- `customcachepath`
- `colorconfigfilename`
- `defaultinputcolorspace`
- `colorreferencespace`
- `root` — pointer id of the root `Folder` node, resolved after all nodes are loaded.
- `root`:根 `Folder` 节点的指针 ID,在所有节点加载完成后解析。
---
## 4. Node Serialization (`Node::Save` / `Node::Load`) / 节点序列化
### 4.1 `label`
User-visible node label.
用户可见的节点标签。
### 4.2 `color`
Override color index (integer), only written if not `-1`.
覆盖颜色索引(整数),只有不为 `-1` 时才写出。
### 4.3 `input` / 输入
Each input is serialized as:
每个输入序列化为:
```xml
......
```
- `primary`: element `-1` (the main input).
- `primary`:元素 `-1`(主输入)。
- `subelements`: array elements (if the input is an array). `count` is the array size.
- `subelements`:数组元素(如果输入是数组)。`count` 为数组大小。
#### 4.3.1 Immediate Values (`primary` / `element`) / 立即值
Each immediate block contains:
每个立即值块包含:
```xml
0|1
...
............
```
- `keyframing`: whether the input is keyframed (only written if the input is keyframable).
- `keyframing`:输入是否启用关键帧(仅当输入可关键帧化时写出)。
- `standard`: default/static values (one `