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
.json
.
Auto-Editor can generate v3 timelines from media files (instructed
with --edit
),
auto-editor example.mp4 --export timeline:api=3 -o input-v3.json
render media files from the v3 format,
auto-editor input-v3.json -o output.mkv
and translate other timeline formats to v3:
auto-editor input-fcp7.xml --export timeline:api=3 -o output-v3.json
This format is considered partially-stable. Breaking changes can be made to feature level changes, but not patch level changes.
shown using TypeScript notation, the keys can be set to the following values.
type Integer = number; // An integer floating-point value.
type Natural = number; // An integer floating-point value that is >= 0.
type Source = string; // A path to a media file, must be valid for the given platform.
type SupportedSpeed = float; // Between 0.0 exclusive and 99999.0 exclusive.
interface v3 {
: "3"; // Must always be set as "3".
version: [number, number]; // width and height. Must both be natural numbers.
resolution: string; // The timebase. Must be a rational number.
timebase// Typical values are: "24/1", 30/1", "30000/1001"
// Values with a decimal ("29.97") should be rejected.
: number; // The overall samplerate, must be a natural number.
samplerate
: string; // A web RGB color value for the background. Relevant in cases
background// like when a video has a different aspect ratio than the..
// global resolution. Must be in the format "#000" or "#000000".
: Video[][];
v: Audio[][];
a }
The elements in the v
and a
keys are a
tagged union with name
as the discriminant.
interface Video {
: "video";
name: Source;
src: Natural; // Where in this timeline to start this clip. In terms of timebase.
start: Natural; // The duration of the clip. In terms of timebase.
dur: Natural; // Where from the source to start playing at. In terms of timebase.
offset: SupportedSpeed;
speed: Natural; // Which video stream from the source to use.
stream// Usually stream 0.
}
interface Audio {
: "audio";
name: Source;
src: Natural;
start: Natural;
dur: Natural;
offset: float; // A float between 0.0 and 1.0. Changes the audio loudness.
volume: Natural; // Which audio stream from the source to use.
stream }
The v3 format looks something like this:
{
"version": "3",
"resolution": [1280, 720],
"timebase": "30/1",
"samplerate": 48000,
"background": "#000",
"v": [
[
{
"name": "video",
"src": "example.mp4",
"start": 0,
"dur": 26,
"offset": 0,
"speed": 1.0,
"stream": 0
},
{
"name": "video",
"src": "example.mp4",
"start": 26,
"dur": 362,
"offset": 34,
"speed": 1.0,
"stream": 0
},
...
]
],
"a": [
[
{
"name": "audio",
"src": "example.mp4",
"start": 0,
"dur": 26,
"offset": 0,
"speed": 1.0,
"volume": 1,
"stream": 0
},
{
"name": "audio",
"src": "example.mp4",
"start": 26,
"dur": 362,
"offset": 34,
"speed": 1.0,
"volume": 1,
"stream": 0
},
...
]
]
}
There are two additional video elements:
// Draw an image
interface Image {
: "image";
name: Source;
src: Natural; // Where in this timeline to start this clip. In terms of timebase.
start: Natural; // The duration of the clip. In terms of timebase.
dur: Integer;
x: Integer;
y: Natural;
width: float;
opacity
}
// Draw a rectangle with a solid color
interface Rect {
: "rect";
name: Natural;
start: Natural;
dur: Integer;
x: Integer;
y: Natural;
width: Natural;
height: string;
fill }