The v3 format

Overview

The v3 format is a nonlinear timeline file format. It supports multiple overlapping video and audio layers. The v3 format is a subset of JSON, and the proper extension is .v3.

Auto-Editor can generate v3 timelines from media files (instructed with --edit),

auto-editor example.mp4 --export v3 -o input.v3

render media files from the v3 format,

auto-editor input.v3 -o output.mkv

and translate other timeline formats to v3:

auto-editor input-fcp7.xml --export v3 -o output.v3
auto-editor input.fcpxml --export v3 -o output.v3
auto-editor input.edl --export v3 -o output.v3

Stability

This format is considered partially-stable. Breaking changes can be made to feature level changes, but not patch level changes.

The Spec

Shown using TypeScript notation, the format can be described:

type Natural = number; // Number that is >= 0.

interface v3 {
  version: "3";        // Must always be set as "3".
  templateFile?: string;
                       // Copy attachment streams for rendering, if any.
  timebase: string;    // The timebase. Must be a rational number.
                       // Typical values are: "24/1", 30/1", "30000/1001"
  background: string;  // A web RGB color value for the background. Must be in the
                       // format "#000" or "#000000".
  resolution: [Natural , Natural];
                       // width and height. Must be even numbers.
  samplerate: Natural; // The overall samplerate.
  layout: string;      // The audio channel layout, e.g. "mono", "stereo".
  langs: string[];     // Language tag per track (video tracks first, then audio),
                       // e.g. "eng" or "und" when unknown.
  c: CaptionTrack[];   // Caption tracks; see "Captions" below.
  v: Clip[][];         // Video layers. Each layer must contain at least one clip;
                       // an empty layer is malformed and rejected.
  a: Clip[][];         // Audio layers. Same rule: layers must be non-empty.
  sidecar: Clip[][];   // Subtitle streams carried through the cuts; see "Captions".
                       // Same rule: layers must be non-empty.
  transitions?: {      // Optional edit-point transitions, indexed like v/a.
    v: Transition[][];
    a: Transition[][];
  };
  markers?: Marker[];  // Optional named points and spans; see "Markers".
}

interface CaptionTrack {
  lang: string;        // Language tag, e.g. "eng", or "und" when unknown.
  cues: Caption[];     // At least one.
}

interface Caption {
  start: Natural;      // Timeline frame the cue appears at. In terms of timebase.
  dur: Natural;        // How long it stays, in terms of timebase. Must be positive.
  text: string;        // The cue's text; "\n" separates lines.
}

interface Transition {
  kind: string;        // "dissolve", or another kind from the Transitions page.
                       // Audio layers take "dissolve", "constant-power" or
                       // "exponential-fade".
  at: Natural;         // Edit point in timeline frames.
  dur: Natural;        // Positive transition duration in timeline frames.
  alignment: "start" | "center" | "end";
}

interface Marker {
  start: Natural;      // Timeline frame it's at. In terms of timebase.
  dur?: Natural;       // Its span in timeline frames; 0 or absent for a point.
  name?: string;
  note?: string;
  color?: string;      // "blue" (default), "red", "orange", "yellow", "green",
                       // "cyan", "purple", "pink" or "white".
}

interface Clip {
  src: string;         // Path to a media file
  start: Natural;      // Where in this timeline to start this clip. In terms of timebase.
  dur: Natural;        // The duration of the clip. In terms of timebase.
  offset: Natural;     // Where from the source to start playing at. In terms of timebase.
  stream: Natural;     // Which stream of the source to use, among those of the
                       // layer's kind: video streams in `v`, audio in `a`,
                       // subtitle streams in `sidecar`. Usually stream 0.
  effects?: string[];  // Optional. See "Effects" below. Overlay placement is a
                       // `pos:x:y[:scale]` effect; see "Compositing layers".
}

Compositing layers

When more than one video track has a clip active at the same timeline frame, the tracks are composited bottom-to-top: v[0] is the base layer and later tracks (v[1], v[2], ...) are painted on top. The base layer fills the canvas (its source is fit to resolution). Each higher layer is placed by a pos:x:y[:scale] effect in its effects array — x/y are the top-left corner in canvas pixels and scale (default 1.0) multiplies the source's native size. Without a pos effect, an overlay is scaled to fit the canvas (preserving aspect ratio) and centered, like a full-frame layer. Other per-clip effects are applied to each clip before it is composited.

Still images (PNG, JPG, BMP, TIFF, ...) may be used as a src; the single image is held for the clip's whole dur, which is convenient for logos and watermarks. Overlay transparency (e.g. a PNG alpha channel) is preserved.

"v": [
  [ { "src": "example.mp4", "start": 0, "dur": 60, "offset": 0, "stream": 0 } ],
  [ { "src": "pip.mp4", "start": 0, "dur": 60, "offset": 0, "stream": 0, "effects": ["pos:900:60:0.25"] } ],
  [ { "src": "logo.png", "start": 0, "dur": 60, "offset": 0, "stream": 0, "effects": ["pos:40:40"] } ]
]

For best results, the base track (v[0]) should span every frame you intend to render; a frame where only a higher track is active is treated as a single full-frame layer.

Captions

Subtitles come in two forms.

c holds captions written inline: each track is a list of cues with their own timing and text. When rendered, every track becomes a text subtitle stream in the output, in the container's native form (mov_text in MP4 and MOV, ASS in Matroska, WebVTT in WebM). The final-cut-pro and resolve exports write them as FCPXML <caption> elements, which auto-editor can import.

sidecar holds subtitle streams that already exist in a source, as layers of clips like v and a: stream is the index among the source's subtitle streams, and the clips follow the same cuts as the media. When rendered, the stream's cues are copied through with their timing moved to the cut timeline, so a video's embedded subtitles stay in sync without being parsed. Generating a v3 from a file with subtitle streams fills sidecar with one layer per stream.

The clips of a sidecar layer may come from different files, as they do when inputs are concatenated. The layer's first clip decides the output stream's codec; a later clip whose stream is another codec is left out with a warning, since cues are copied, not converted. For the same reason effects on sidecar clips are ignored: a cue keeps its source timing within its clip.

"c": [
  { "lang": "eng", "cues": [
    { "start": 0, "dur": 45, "text": "Hello." },
    { "start": 60, "dur": 30, "text": "Two lines\nof text." }
  ] }
],
"sidecar": [
  [ { "src": "example.mkv", "start": 0, "dur": 60, "offset": 0, "stream": 0 } ]
]

Markers

markers names points and spans of the timeline. Each has a start in timeline frames, a dur (0, or left out, for a point), a name, a note, and a color: one of blue, red, orange, yellow, green, cyan, purple, pink, or white. A missing color is blue, and so is one not in that list, with a warning. auto-editor writes the key only when there are markers.

From the command line, --marker sets them in the input's time, and auto-editor places them through the edit: a marker in a cut-out section moves to the next kept frame, and one past every kept frame is left out. Every editor export carries them, each keeping what its format has a place for, and reports the parts it left out:

Export Written as Keeps
premiere-otio markers on the timeline's stack name, note, color, span
premiere sequence markers name, note, color (pink as purple), span
resolve-fcp7 sequence markers name, note, span
final-cut-pro markers on the clip each starts during; a span ends with its clip name, note, span
resolve as final-cut-pro, but Resolve reads no markers from FCPXML: use resolve-fcp7 to bring them in nothing
edl * LOC: comments at the record time name, color (orange as yellow, purple and pink as magenta)
shotcut timeline markers name, color, span
kdenlive timeline guides, with a category per color name, color, span

Importing reads them back:

Import Read from Gets
FCP7 XML the sequence's markers, and each clip's where the clip plays name, note, span; from Premiere's, the color too
FCPXML markers on the storyline's clips and gaps and on connected clips, where the clip plays name, note, span; a to-do marker is red, a completed one green, a chapter marker orange
EDL * LOC: comments, and the events of a Resolve marker list name, color; from Resolve's, the note and span too

A media export writes named markers as chapters: a span's own length, or for a point, up to the next chapter. --no-chapters leaves them out.

"markers": [
  { "start": 90, "dur": 0, "name": "Intro", "color": "red", "note": "" },
  { "start": 300, "dur": 150, "name": "Q&A", "color": "green", "note": "Questions, then answers" }
]

Effects

A clip may carry an optional effects key: an array of action strings applied to that clip. Each string is either a bare action like "invert" or an action with arguments like "speed:8.0", "volume:0.5", or "zoom:2.0". The single-element array ["cut"] means the clip is cut (not included). When effects is absent, the clip plays unaltered at normal speed. See the Actions reference for the full list.

The v3 format looks something like this:

{
  "version": "3",
  "templateFile": "example.mp4",
  "timebase": "30/1",
  "background": "#000",
  "resolution": [1280, 720],
  "samplerate": 48000,
  "layout": "stereo",
  "langs": ["eng", "eng"],
  "c": [],
  "v": [
    [
      {
        "src": "example.mp4",
        "start": 0,
        "dur": 26,
        "offset": 0,
        "stream": 0
      },
      {
        "src": "example.mp4",
        "start": 26,
        "dur": 362,
        "offset": 34,
        "stream": 0
      }
    ]
  ],
  "a": [
    [
      {
        "src": "example.mp4",
        "start": 0,
        "dur": 26,
        "offset": 0,
        "stream": 0
      },
      {
        "src": "example.mp4",
        "start": 26,
        "dur": 362,
        "offset": 34,
        "stream": 0
      }
    ]
  ],
  "sidecar": []
}