A Clip points at its media
through one or more media references, and any item can carry effects.
Fields of every media reference
These belong to MediaReference.1, the base type, and to the four types
below.
| Field | Type | Meaning |
|---|---|---|
name | string | Name. |
metadata | dictionary | Extra data. |
available_range | TimeRange or null | The range the media covers. |
available_image_bounds | Box2d or null | The image bounds. |
All four are optional when reading (name and metadata default to
an empty string and an empty dictionary; the other two to null).
ExternalReference.1
Adds target_url, a string: the address of the media. Required when reading.
MissingReference.1
No extra fields. It stands for media that cannot be found.
GeneratorReference.1
| Field | Type | Meaning |
|---|---|---|
generator_kind | string | Which generator. |
parameters | dictionary | Its settings. |
Both fields are required when reading.
ImageSequenceReference.1
Numbered image files. The address of frame n is built from the fields below.
| Field | Type | Library default | Meaning |
|---|---|---|---|
target_url_base | string | empty | Everything up to the file name. |
name_prefix | string | empty | Everything in the file name before the frame number. |
name_suffix | string | empty | Everything after the frame number. |
start_frame | integer | 1 | The first frame number used in file names. |
frame_step | integer | 1 | Step between frame numbers in file names. |
rate | double | 1 | Frame rate if every frame in the sequence were played. |
frame_zero_padding | integer | 0 | Digits to pad the frame number to. |
missing_frame_policy | string | "error" | What to do with frames not found during playback or rendering. |
Required and optional: a reader (the C++ read_from) requires all eight
fields above in the object (a missing one is an error), then reads the
fields of every media reference, which are optional.
What the fields mean together
From imageSequenceReference.cpp (current main branch). Image number n
counts from 0 along the sequence; the integer fields are read from the file as 64-bit
integers and narrowed to 32-bit.
- Number in the file name =
start_frame+ n ×frame_step. - The digits are that number’s absolute value, left-padded with zeros to at least
frame_zero_paddingdigits (no padding if the number already has that many). A negative number gets a-placed before the zero padding (-0012, not00-12). - Address =
target_url_base, then a/only when the base is not empty and does not already end with/, thenname_prefix, the sign, the zero padding, the digits andname_suffix. - Number of images = the duration of
available_rangecounted in frames at the raterate÷frame_step(0 if there is noavailable_range). Asking for an address of image n ≥ that number is an error, and so is asking whenrateis 0 or the range is missing or has zero duration. - Frame duration =
frame_stepunits atrate. - End frame (the last file number, inclusive) =
start_frame+ frames in the range atrate− 1; with noavailable_rangeit isstart_frame. - Presentation time of image n =
the start time of
available_range+ n × the frame duration, that isstart+ n ×frame_step÷rateseconds, expressed at the raterate(the library applies aTimeTransformwith offset = range start and scale = n to the frame duration). It needs anavailable_rangeand n below the number of images; a larger n is an error. Image 0 is at the start of the range, and n counts images, not file numbers. - File number for a time =
start_frame+ the frames from the start ofavailable_rangeto that time, counted atrate; a time outside the range is an error.
Example: target_url_base "/shots/a", name_prefix
"img.", name_suffix ".exr", start_frame 1001,
frame_step 1, frame_zero_padding 6: image 0 is
/shots/a/img.001001.exr.
missing_frame_policy
A string in the file. Any other string makes the reader fail with “Unknown missing_frame_policy”. It is never an integer.
| Value in the file | Meaning |
|---|---|
"error" | Stop and raise an error. |
"hold" | Hold the last available frame before the missing one. |
"black" | Use a black frame instead. |
Effects
All effect types have name, metadata,
effect_name (a string) and enabled (a boolean: if false, the
effect is omitted). Defaults: enabled true; name and
effect_name empty. On reading, effect_name is required (and so is
time_scalar for LinearTimeWarp and FreezeFrame);
enabled, name and metadata are optional.
| Schema | Extra field | Meaning |
|---|---|---|
Effect.1 | A general effect. | |
TimeEffect.1 | An effect on time. | |
LinearTimeWarp.1 | time_scalar (double, default 1.0) | Applied to the clip: 2.0 is double speed and 0.5 is half speed. The item’s duration does not change. |
FreezeFrame.1 | time_scalar (double, default 0.0) | A freeze frame: it holds the first frame of the clip for the whole length of the clip (the library’s own description, FreezeFrame.1 in the serialized-schema document). It is a linear time warp whose constructor sets effect_name to "FreezeFrame" and time_scalar to 0.0, written with the same field as a linear time warp. |