XKV

Vector Keyframe Media Format

Overview

XKV is an open, resolution-independent media format for vector-based animation. It stores animated scalable vector graphics in a simple container designed for web-native playback and decentralized distribution.

---

Design Goals

---

File Structure

An XKV file is UTF-8 encoded JSON.

{
  "xkv": 1,
  "meta": { ... },
  "timeline": [ ... ],
  "assets": { ... }
}
---

Header

"xkv": 1

Required. Identifies the file as XKV and declares container version.

---

Meta Block

{
  "width": 640,
  "height": 480,
  "fps": 12,
  "title": "Example Animation",
  "author": "creator name",
  "audio": "optional-audio.ogg"
}

Required fields: width, height, fps.

---

Timeline — Frame Mode

Simple frame-by-frame animation.

"timeline": [
  { "svg": "<svg>...</svg>" },
  { "svg": "<svg>...</svg>" }
]
Frames display sequentially at the declared FPS. ---

Timeline — Keyframe Mode

Reusable vector assets with transforms.

"assets": {
  "shape1": "<path d='M10 10...' />"
},

"timeline": [
  {
    "t": 0.0,
    "use": ["shape1"],
    "transform": {
      "shape1": "translate(20,0)"
    }
  }
]
Interpolation rules are implementation-defined in spec v0.1. ---

Minimal Example

{
  "xkv": 1,
  "meta": { "width":200, "height":200, "fps":2 },
  "timeline": [
    { "svg":"<svg viewBox='0 0 200 200'><circle cx='40' cy='100' r='20' fill='black'/></svg>" },
    { "svg":"<svg viewBox='0 0 200 200'><circle cx='160' cy='100' r='20' fill='black'/></svg>" }
  ]
}
---

Playback

An XKV player parses the JSON, loads SVG frames, and swaps them at the declared FPS. Because content is vector-based, playback scales to any resolution.

---

Status

XKV is an experimental open media format. This specification describes version 0.1 of the container.

---

Reference Implementation

A vanilla JavaScript reference player and encoder are in development.

---