@pixerate/editor 0.85.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/video-editor/index.cjs +879 -101
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +313 -1
- package/dist/video-editor/index.d.ts +313 -1
- package/dist/video-editor/index.js +800 -22
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-video-editor/SKILL.md +24 -1
|
@@ -268,6 +268,13 @@ interface VideoMediaClip extends VideoClipBase {
|
|
|
268
268
|
in?: number;
|
|
269
269
|
/** Playback speed (default 1): it uses `duration × speed` of the source. */
|
|
270
270
|
speed?: number;
|
|
271
|
+
/**
|
|
272
|
+
* A speed ramp: keys mapping clip time to source time after the in point (`v` ms from `in`), so
|
|
273
|
+
* a key's slope is the speed there, a flat stretch is a freeze frame and eased keys ramp between
|
|
274
|
+
* speeds. Never runs backwards. Before the first key and after the last the picture holds. Takes
|
|
275
|
+
* the place of `speed` (see `videoSpeedRampKeys` for building one from speeds).
|
|
276
|
+
*/
|
|
277
|
+
timeRemap?: VideoKeyframes;
|
|
271
278
|
/** Gain (1 = unchanged, default 1), or keyframes. */
|
|
272
279
|
volume?: VideoAnimatable;
|
|
273
280
|
/** Silences this clip. */
|
|
@@ -344,6 +351,7 @@ declare function parseVideoAnimatable(v: unknown, path: string, range?: {
|
|
|
344
351
|
optional?: boolean;
|
|
345
352
|
}): VideoAnimatable | undefined;
|
|
346
353
|
declare function parseVideoTransform(v: unknown, path: string): VideoTransform | undefined;
|
|
354
|
+
declare function parseVideoTimeRemap(v: unknown, speed: unknown, path: string): VideoKeyframes | undefined;
|
|
347
355
|
declare function parseVideoClipAnimation(v: unknown, path: string): VideoClipAnimation | undefined;
|
|
348
356
|
declare function parseVideoGrade(v: unknown, path: string): VideoGrade | undefined;
|
|
349
357
|
declare function parseVideoTransition(v: unknown, path: string): VideoTransition | undefined;
|
|
@@ -635,6 +643,18 @@ type VideoEdit = ({
|
|
|
635
643
|
clip: string;
|
|
636
644
|
property: VideoKeyframeProperty;
|
|
637
645
|
keys: VideoKey[] | null;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* A speed ramp: keys mapping clip time to source ms after the in point (see `timeRemap`), or
|
|
649
|
+
* null to play at normal speed from where the ramp started. `duration` sets the clip's new length
|
|
650
|
+
* (default: unchanged); `ripple` moves later material with the change.
|
|
651
|
+
*/
|
|
652
|
+
| {
|
|
653
|
+
op: 'set_time_remap';
|
|
654
|
+
clip: string;
|
|
655
|
+
keys: VideoKey[] | null;
|
|
656
|
+
duration?: number;
|
|
657
|
+
ripple?: boolean;
|
|
638
658
|
} | {
|
|
639
659
|
op: 'close_gaps';
|
|
640
660
|
track: string;
|
|
@@ -1018,6 +1038,223 @@ declare function videoGradeSvgDefs(grade: VideoGrade | undefined): {
|
|
|
1018
1038
|
/** A grade as ffmpeg filters on RGB, in order: `lutrgb` for exposure and contrast, `colorchannelmixer` for the rest. */
|
|
1019
1039
|
declare function videoGradeFfmpegFilters(grade: VideoGrade | undefined): string[];
|
|
1020
1040
|
|
|
1041
|
+
/**
|
|
1042
|
+
* Colour scopes: a histogram, a luma waveform and a vectorscope, worked out from a frame's pixels,
|
|
1043
|
+
* plus exposure and clipping figures. Pure functions on RGBA pixels as `ImageData` holds them, so
|
|
1044
|
+
* the same numbers come from a preview canvas, a decoded export frame or a test.
|
|
1045
|
+
*
|
|
1046
|
+
* Luma and chroma use the Rec. 709 weights on the gamma-encoded values (Y′, Cb, Cr), as broadcast
|
|
1047
|
+
* scopes do: luma 0 is black and 1 white; Cb and Cr run from −0.5 to 0.5.
|
|
1048
|
+
*/
|
|
1049
|
+
/** RGBA pixels, 4 values (0–255) a pixel, rows top to bottom: an `ImageData` fits. */
|
|
1050
|
+
interface VideoPixels {
|
|
1051
|
+
width: number;
|
|
1052
|
+
height: number;
|
|
1053
|
+
data: ArrayLike<number>;
|
|
1054
|
+
}
|
|
1055
|
+
type VideoScopeKind = 'histogram' | 'waveform' | 'vectorscope';
|
|
1056
|
+
declare const VIDEO_SCOPE_KINDS: readonly ["histogram", "waveform", "vectorscope"];
|
|
1057
|
+
/** Rec. 709 luma of gamma-encoded RGB (each 0–1). */
|
|
1058
|
+
declare const videoLuma: (r: number, g: number, b: number) => number;
|
|
1059
|
+
/** Rec. 709 chroma (Cb, Cr), each −0.5 to 0.5, of gamma-encoded RGB (each 0–1). */
|
|
1060
|
+
declare function videoChroma(r: number, g: number, b: number): [number, number];
|
|
1061
|
+
interface VideoScopeOptions {
|
|
1062
|
+
/**
|
|
1063
|
+
* Read at most about this many pixels, evenly spaced (default 262 144, a 512 × 512 picture), so
|
|
1064
|
+
* a large frame costs no more than a small one. Counts are of the pixels read.
|
|
1065
|
+
*/
|
|
1066
|
+
maxPixels?: number;
|
|
1067
|
+
}
|
|
1068
|
+
/** How many pixels fall in each of `bins` equal steps of red, green, blue and luma (bin 0 is darkest). */
|
|
1069
|
+
interface VideoHistogram {
|
|
1070
|
+
bins: number;
|
|
1071
|
+
r: number[];
|
|
1072
|
+
g: number[];
|
|
1073
|
+
b: number[];
|
|
1074
|
+
luma: number[];
|
|
1075
|
+
/** Pixels counted. */
|
|
1076
|
+
total: number;
|
|
1077
|
+
}
|
|
1078
|
+
declare function videoHistogram(pixels: VideoPixels, options?: VideoScopeOptions & {
|
|
1079
|
+
bins?: number;
|
|
1080
|
+
}): VideoHistogram;
|
|
1081
|
+
/**
|
|
1082
|
+
* A luma waveform: the picture split into `columns` vertical strips, left to right, each counting
|
|
1083
|
+
* its pixels at each of `levels` luma steps. `data[column * levels + level]`; level 0 is black.
|
|
1084
|
+
*/
|
|
1085
|
+
interface VideoWaveform {
|
|
1086
|
+
columns: number;
|
|
1087
|
+
levels: number;
|
|
1088
|
+
data: Uint32Array;
|
|
1089
|
+
/** The largest count, for scaling a drawing. */
|
|
1090
|
+
peak: number;
|
|
1091
|
+
}
|
|
1092
|
+
declare function videoLumaWaveform(pixels: VideoPixels, options?: VideoScopeOptions & {
|
|
1093
|
+
columns?: number;
|
|
1094
|
+
levels?: number;
|
|
1095
|
+
}): VideoWaveform;
|
|
1096
|
+
/**
|
|
1097
|
+
* A vectorscope: pixels counted on a `size` × `size` grid by chroma, Cb across (left −0.5, right
|
|
1098
|
+
* +0.5) and Cr up (top +0.5). The centre is grey; the further out, the more saturated; the angle
|
|
1099
|
+
* is the hue. `data[row * size + column]`.
|
|
1100
|
+
*/
|
|
1101
|
+
interface VideoVectorscope {
|
|
1102
|
+
size: number;
|
|
1103
|
+
data: Uint32Array;
|
|
1104
|
+
peak: number;
|
|
1105
|
+
}
|
|
1106
|
+
/** Where chroma (Cb, Cr) falls on a vectorscope of `size` pixels, as `[column, row]`. */
|
|
1107
|
+
declare const videoVectorscopePoint: (cb: number, cr: number, size: number) => [number, number];
|
|
1108
|
+
declare function videoVectorscope(pixels: VideoPixels, options?: VideoScopeOptions & {
|
|
1109
|
+
size?: number;
|
|
1110
|
+
}): VideoVectorscope;
|
|
1111
|
+
/** Exposure and colour figures for a frame (see `videoExposureStats`). Luma and levels run 0–1. */
|
|
1112
|
+
interface VideoExposureStats {
|
|
1113
|
+
/** Pixels read. */
|
|
1114
|
+
pixels: number;
|
|
1115
|
+
luma: {
|
|
1116
|
+
mean: number;
|
|
1117
|
+
median: number;
|
|
1118
|
+
min: number;
|
|
1119
|
+
max: number;
|
|
1120
|
+
p1: number;
|
|
1121
|
+
p99: number;
|
|
1122
|
+
};
|
|
1123
|
+
/** Share (0–1) of pixels crushed to black (luma at or below `shadowLevel`) or blown to white (at or above `highlightLevel`). */
|
|
1124
|
+
clipped: {
|
|
1125
|
+
shadows: number;
|
|
1126
|
+
highlights: number;
|
|
1127
|
+
r: number;
|
|
1128
|
+
g: number;
|
|
1129
|
+
b: number;
|
|
1130
|
+
};
|
|
1131
|
+
/** Mean and highest chroma, 0 (grey) to 1 (a full primary). */
|
|
1132
|
+
saturation: {
|
|
1133
|
+
mean: number;
|
|
1134
|
+
max: number;
|
|
1135
|
+
};
|
|
1136
|
+
/** The mean colour as `#rrggbb`: far from grey means a colour cast. */
|
|
1137
|
+
average: string;
|
|
1138
|
+
}
|
|
1139
|
+
interface VideoExposureOptions extends VideoScopeOptions {
|
|
1140
|
+
/** Luma (0–1) at or below which a pixel counts as crushed (default 0.02). */
|
|
1141
|
+
shadowLevel?: number;
|
|
1142
|
+
/** Luma or channel (0–1) at or above which a pixel counts as blown (default 0.98). */
|
|
1143
|
+
highlightLevel?: number;
|
|
1144
|
+
}
|
|
1145
|
+
declare function videoExposureStats(pixels: VideoPixels, options?: VideoExposureOptions): VideoExposureStats;
|
|
1146
|
+
/** What a scope reading says in words: exposure, clipping and colour cast worth fixing. */
|
|
1147
|
+
declare function videoExposureNotes(stats: VideoExposureStats): string[];
|
|
1148
|
+
/** A compact reading of a frame for agents: exposure figures, notes, and coarse histogram, waveform and vectorscope summaries. */
|
|
1149
|
+
interface VideoScopeSummary {
|
|
1150
|
+
stats: VideoExposureStats;
|
|
1151
|
+
notes: string[];
|
|
1152
|
+
/** Share of pixels (0–1) in each of `bins` equal luma and channel steps, darkest first. */
|
|
1153
|
+
histogram: {
|
|
1154
|
+
bins: number;
|
|
1155
|
+
luma: number[];
|
|
1156
|
+
r: number[];
|
|
1157
|
+
g: number[];
|
|
1158
|
+
b: number[];
|
|
1159
|
+
};
|
|
1160
|
+
/** The picture in vertical strips, left to right: each strip's luma spread (0–1). */
|
|
1161
|
+
waveform: {
|
|
1162
|
+
start: number;
|
|
1163
|
+
end: number;
|
|
1164
|
+
min: number;
|
|
1165
|
+
median: number;
|
|
1166
|
+
max: number;
|
|
1167
|
+
}[];
|
|
1168
|
+
/** The chroma of the most saturated tenth of the picture: its main hue (degrees on the vectorscope, red ≈ 103°) and strength (0–1). */
|
|
1169
|
+
vectorscope: {
|
|
1170
|
+
hue: number | null;
|
|
1171
|
+
strength: number;
|
|
1172
|
+
spread: number;
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
/** Vectorscope angle (degrees, anticlockwise from +Cb) of chroma. */
|
|
1176
|
+
declare const videoVectorscopeAngle: (cb: number, cr: number) => number;
|
|
1177
|
+
declare function summarizeVideoScopes(pixels: VideoPixels, options?: VideoExposureOptions & {
|
|
1178
|
+
bins?: number;
|
|
1179
|
+
columns?: number;
|
|
1180
|
+
}): VideoScopeSummary;
|
|
1181
|
+
/** Where the six 75% colour-bar targets sit on a vectorscope: name, Cb and Cr. */
|
|
1182
|
+
declare const VIDEO_VECTORSCOPE_TARGETS: readonly {
|
|
1183
|
+
name: string;
|
|
1184
|
+
rgb: [number, number, number];
|
|
1185
|
+
cb: number;
|
|
1186
|
+
cr: number;
|
|
1187
|
+
}[];
|
|
1188
|
+
/** RGBA pixels of a drawn scope, ready for `new ImageData(data, width, height)`. */
|
|
1189
|
+
interface VideoScopeImage {
|
|
1190
|
+
width: number;
|
|
1191
|
+
height: number;
|
|
1192
|
+
data: Uint8ClampedArray<ArrayBuffer>;
|
|
1193
|
+
}
|
|
1194
|
+
/** A histogram drawn `width` × `height`: red, green and blue added together, with luma as a white outline. */
|
|
1195
|
+
declare function videoHistogramImage(h: VideoHistogram, width?: number, height?: number): VideoScopeImage;
|
|
1196
|
+
/** A luma waveform drawn `width` × `height`: white at the top, black at the bottom, lines at each quarter. */
|
|
1197
|
+
declare function videoWaveformImage(w: VideoWaveform, width?: number, height?: number): VideoScopeImage;
|
|
1198
|
+
/** A vectorscope drawn `size` × `size`, with its outer circle, the skin-tone line and the colour-bar targets. */
|
|
1199
|
+
declare function videoVectorscopeImage(v: VideoVectorscope, size?: number): VideoScopeImage;
|
|
1200
|
+
/** One scope of a frame drawn `width` × `height` (a vectorscope is square: the smaller side). */
|
|
1201
|
+
declare function videoScopeImage(kind: VideoScopeKind, pixels: VideoPixels, width?: number, height?: number, options?: VideoScopeOptions): VideoScopeImage;
|
|
1202
|
+
/** A frame the preview drew: when, whether every picture in it had loaded, and its pixels. */
|
|
1203
|
+
interface VideoPreviewSnapshot {
|
|
1204
|
+
time: number;
|
|
1205
|
+
/** False while a picture is still loading or seeking (the frame shows a placeholder or a stale picture). */
|
|
1206
|
+
complete: boolean;
|
|
1207
|
+
pixels: VideoPixels;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Where a preview's pixels can be read, for scopes and agents: a `VideoPreviewEngine` attaches its
|
|
1211
|
+
* canvas and says each time it draws. `VideoEditorController.previewPixels` is one, so a preview,
|
|
1212
|
+
* a scopes panel and the agent tools of one editor find each other without wiring.
|
|
1213
|
+
*/
|
|
1214
|
+
declare class VideoPreviewPixels {
|
|
1215
|
+
private reader;
|
|
1216
|
+
private drawnAt;
|
|
1217
|
+
private readonly listeners;
|
|
1218
|
+
/** Gives the canvas to read (the latest preview wins). Returns a function that takes it away again. */
|
|
1219
|
+
attach(reader: () => VideoPreviewSnapshot | null): () => void;
|
|
1220
|
+
/** Whether a preview is attached. */
|
|
1221
|
+
get attached(): boolean;
|
|
1222
|
+
/** The preview drew the frame at `time`; `complete` is false while a picture was missing or stale. */
|
|
1223
|
+
drawn(time: number, complete: boolean): void;
|
|
1224
|
+
/** The last frame drawn, with its pixels; `null` without a preview. Throws when the canvas cannot be read. */
|
|
1225
|
+
read(): VideoPreviewSnapshot | null;
|
|
1226
|
+
/** Called after each frame the preview draws. */
|
|
1227
|
+
subscribe(listener: () => void): () => void;
|
|
1228
|
+
/**
|
|
1229
|
+
* The frame at `time` once it is complete: now, if the last frame drawn was it, else the next
|
|
1230
|
+
* complete drawing of it. Fails after `timeout` ms (default 5000).
|
|
1231
|
+
*/
|
|
1232
|
+
next(time: number, timeout?: number): Promise<VideoPreviewSnapshot>;
|
|
1233
|
+
private emit;
|
|
1234
|
+
}
|
|
1235
|
+
/** What a scopes panel shows for the preview's latest frame (see `readVideoScopesPanel`). */
|
|
1236
|
+
type VideoScopesPanelReading = {
|
|
1237
|
+
ok: true;
|
|
1238
|
+
time: number;
|
|
1239
|
+
complete: boolean;
|
|
1240
|
+
images: Partial<Record<VideoScopeKind, VideoScopeImage>>;
|
|
1241
|
+
stats: VideoExposureStats;
|
|
1242
|
+
notes: string[];
|
|
1243
|
+
} | {
|
|
1244
|
+
ok: false;
|
|
1245
|
+
message: string;
|
|
1246
|
+
};
|
|
1247
|
+
/**
|
|
1248
|
+
* The preview's latest frame as a scopes panel draws it: an image per scope `kinds`, each
|
|
1249
|
+
* `width` × `height` (vectorscopes square), and the exposure figures. Reads at most `maxPixels`
|
|
1250
|
+
* (default 65 536) so it keeps up with playback. Says why when there is nothing to show.
|
|
1251
|
+
*/
|
|
1252
|
+
declare function readVideoScopesPanel(feed: VideoPreviewPixels, kinds?: readonly VideoScopeKind[], options?: {
|
|
1253
|
+
width?: number;
|
|
1254
|
+
height?: number;
|
|
1255
|
+
maxPixels?: number;
|
|
1256
|
+
}): VideoScopesPanelReading;
|
|
1257
|
+
|
|
1021
1258
|
/** Default length of an entrance or exit animation (ms). */
|
|
1022
1259
|
declare const VIDEO_CLIP_ANIMATION_DURATION = 500;
|
|
1023
1260
|
declare const PROPS: readonly ["opacity", "x", "y", "scale"];
|
|
@@ -1123,6 +1360,55 @@ declare function videoTranscriptEdit(assetId: string, text: string): VideoEdit;
|
|
|
1123
1360
|
/** The word playing at a timeline time, as its index in `words`, or -1. */
|
|
1124
1361
|
declare function videoWordAt(words: readonly VideoTimelineWord[], time: number): number;
|
|
1125
1362
|
|
|
1363
|
+
/**
|
|
1364
|
+
* Speed ramps and freeze frames: a media clip's `timeRemap` keys map clip time to source time after
|
|
1365
|
+
* its in point. The slope between two keys is the speed there; equal values are a freeze; an eased
|
|
1366
|
+
* segment changes speed smoothly. These helpers read and build them.
|
|
1367
|
+
*/
|
|
1368
|
+
/** Where in the source (ms) a media clip is at clip time `clipTime`, through its speed or its ramp. */
|
|
1369
|
+
declare function videoClipSourceTime(clip: VideoMediaClip, clipTime: number): number;
|
|
1370
|
+
/** The speed a media clip plays at at clip time `clipTime` (0 in a freeze), measured over a millisecond. */
|
|
1371
|
+
declare function videoClipSpeedAt(clip: VideoClip, clipTime: number): number;
|
|
1372
|
+
/** One stretch of a ramp: `duration` ms of the clip at `speed`, or easing from `speed` to `toSpeed`. 0 is a freeze. */
|
|
1373
|
+
interface VideoSpeedSegment {
|
|
1374
|
+
duration: number;
|
|
1375
|
+
speed: number;
|
|
1376
|
+
/** Ramp smoothly to this speed by the end of the stretch (default: stay at `speed`). */
|
|
1377
|
+
toSpeed?: number;
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Remap keys for stretches of speed, from the clip's start: steady stretches are linear segments,
|
|
1381
|
+
* ramps a cubic-bezier ease that changes the speed evenly from one to the other (the source moves
|
|
1382
|
+
* the average of the two speeds over the stretch). Returns the keys and the source the clip plays.
|
|
1383
|
+
*/
|
|
1384
|
+
declare function videoSpeedRampKeys(segments: readonly VideoSpeedSegment[]): {
|
|
1385
|
+
keys: VideoKey[];
|
|
1386
|
+
duration: number;
|
|
1387
|
+
source: number;
|
|
1388
|
+
};
|
|
1389
|
+
/**
|
|
1390
|
+
* Checks remap keys: in time order and never going back in the source, eased segments included
|
|
1391
|
+
* (each is sampled, so a curve that overshoots and would play backwards is caught). Throws a
|
|
1392
|
+
* readable error.
|
|
1393
|
+
*/
|
|
1394
|
+
declare function checkVideoTimeRemap(remap: VideoKeyframes, path?: string): void;
|
|
1395
|
+
/** The stretch of source (ms, from the in point) a ramp plays: from its first key's value to its last's. */
|
|
1396
|
+
declare function videoTimeRemapSpan(remap: VideoKeyframes): {
|
|
1397
|
+
from: number;
|
|
1398
|
+
to: number;
|
|
1399
|
+
};
|
|
1400
|
+
/** Clip time and source time pairs tracing a ramp as straight lines (eased stretches sampled every `step` ms), with freezes marked. */
|
|
1401
|
+
declare function videoTimeRemapBreakpoints(remap: VideoKeyframes, step: number): {
|
|
1402
|
+
t: number;
|
|
1403
|
+
v: number;
|
|
1404
|
+
}[];
|
|
1405
|
+
/** The edit that plays a media clip through stretches of speed from the moment it shows at its start (see `videoSpeedRampKeys`). */
|
|
1406
|
+
declare function videoSpeedRampEdit(clip: VideoMediaClip, segments: readonly VideoSpeedSegment[], ripple?: boolean): VideoEdit;
|
|
1407
|
+
/** The edit that holds the frame a media clip shows at clip time `at` for `duration` ms, then plays on (the clip gets longer). */
|
|
1408
|
+
declare function videoFreezeFrameEdit(clip: VideoMediaClip, at: number, duration: number, ripple?: boolean): VideoEdit;
|
|
1409
|
+
/** A slow-motion ramp preset for a clip of `duration` ms: normal speed for half of it, a 500 ms glide down to 0.3×, then 1.5 s at 0.3×. */
|
|
1410
|
+
declare const videoSlowMotionRamp: (duration: number) => VideoSpeedSegment[];
|
|
1411
|
+
|
|
1126
1412
|
/** Radius of an iris `progress` (0–1) open: from nothing to the frame's corners. */
|
|
1127
1413
|
declare const videoIrisRadius: (frame: {
|
|
1128
1414
|
width: number;
|
|
@@ -1285,6 +1571,8 @@ interface VideoPreviewSource {
|
|
|
1285
1571
|
playing: boolean;
|
|
1286
1572
|
};
|
|
1287
1573
|
subscribe(listener: () => void): () => void;
|
|
1574
|
+
/** Where to publish the drawn pixels (a controller has one), for scopes and agents. */
|
|
1575
|
+
previewPixels?: VideoPreviewPixels;
|
|
1288
1576
|
}
|
|
1289
1577
|
/** The parts of a media element the preview drives (so tests can pass fakes). */
|
|
1290
1578
|
interface VideoPreviewMedia {
|
|
@@ -1294,6 +1582,8 @@ interface VideoPreviewMedia {
|
|
|
1294
1582
|
volume: number;
|
|
1295
1583
|
muted: boolean;
|
|
1296
1584
|
paused: boolean;
|
|
1585
|
+
/** True while a seek is under way (the element still shows the old frame). */
|
|
1586
|
+
seeking?: boolean;
|
|
1297
1587
|
readyState: number;
|
|
1298
1588
|
preload: string;
|
|
1299
1589
|
play(): Promise<void> | void;
|
|
@@ -1325,6 +1615,11 @@ interface VideoPreviewOptions {
|
|
|
1325
1615
|
* it. Default: a hidden `<svg>` added to `document.body`. `null` leaves white balance out.
|
|
1326
1616
|
*/
|
|
1327
1617
|
defineSvgFilter?: ((id: string, markup: string) => void) | null;
|
|
1618
|
+
/**
|
|
1619
|
+
* Where to publish the canvas's pixels after each frame, for scopes and the `get_video_scopes`
|
|
1620
|
+
* tool (default: the source's `previewPixels`). `null` publishes nothing.
|
|
1621
|
+
*/
|
|
1622
|
+
pixels?: VideoPreviewPixels | null;
|
|
1328
1623
|
}
|
|
1329
1624
|
/**
|
|
1330
1625
|
* Plays a project in the browser: keeps one `<video>` or `<audio>` element per playing clip in step
|
|
@@ -1344,12 +1639,18 @@ declare class VideoPreviewEngine {
|
|
|
1344
1639
|
private destroyed;
|
|
1345
1640
|
private filterHost;
|
|
1346
1641
|
private readonly filters;
|
|
1642
|
+
private readonly detachPixels;
|
|
1643
|
+
private readonly pixelsTarget;
|
|
1644
|
+
private drawn;
|
|
1645
|
+
private complete;
|
|
1347
1646
|
constructor(source: VideoPreviewSource, canvas: {
|
|
1348
1647
|
width: number;
|
|
1349
1648
|
height: number;
|
|
1350
1649
|
clientWidth?: number;
|
|
1351
1650
|
getContext?: (id: '2d') => unknown;
|
|
1352
1651
|
}, options?: VideoPreviewOptions);
|
|
1652
|
+
/** The canvas's pixels and the frame they show, or `null` when its context cannot be read. */
|
|
1653
|
+
readPixels(): VideoPreviewSnapshot | null;
|
|
1353
1654
|
private createMedia;
|
|
1354
1655
|
private image;
|
|
1355
1656
|
private entry;
|
|
@@ -1418,6 +1719,8 @@ declare class VideoEditorController {
|
|
|
1418
1719
|
readonly player: AnimationPlayer;
|
|
1419
1720
|
/** Sound levels per asset, loaded on demand for waveforms and agents. */
|
|
1420
1721
|
readonly audioPeaks: VideoAudioPeaksCache;
|
|
1722
|
+
/** The pixels the preview last drew, for scopes and `get_video_scopes` (a `VideoPreviewEngine` fills it). */
|
|
1723
|
+
readonly previewPixels: VideoPreviewPixels;
|
|
1421
1724
|
private project;
|
|
1422
1725
|
private issues;
|
|
1423
1726
|
private selection;
|
|
@@ -1518,6 +1821,14 @@ interface VideoEditorToolProviderOptions {
|
|
|
1518
1821
|
data: string;
|
|
1519
1822
|
mimeType: string;
|
|
1520
1823
|
};
|
|
1824
|
+
/**
|
|
1825
|
+
* The rendered pixels of the frame at `time` (ms), for `get_video_scopes` (e.g. a frame decoded
|
|
1826
|
+
* by ffmpeg on a server). Default: what the editor's `<VideoPreview>` draws, through
|
|
1827
|
+
* `controller.previewPixels`, seeking it there and back when `time` is not the playhead.
|
|
1828
|
+
*/
|
|
1829
|
+
framePixels?: (time: number) => VideoPixels | null | Promise<VideoPixels | null>;
|
|
1830
|
+
/** How long `get_video_scopes` waits for the preview to finish drawing a frame (ms, default 5000). */
|
|
1831
|
+
framePixelsTimeout?: number;
|
|
1521
1832
|
}
|
|
1522
1833
|
/** A project as agents see it: settings, assets, and each track's clips in order with their times. */
|
|
1523
1834
|
declare function describeVideoProject(project: VideoProject): {
|
|
@@ -1554,6 +1865,7 @@ declare function describeVideoProject(project: VideoProject): {
|
|
|
1554
1865
|
asset: string;
|
|
1555
1866
|
in?: number;
|
|
1556
1867
|
speed?: number;
|
|
1868
|
+
timeRemap?: VideoKeyframes;
|
|
1557
1869
|
volume?: VideoAnimatable;
|
|
1558
1870
|
muted?: boolean;
|
|
1559
1871
|
fadeInCurve?: VideoFadeCurve;
|
|
@@ -1771,4 +2083,4 @@ declare function videoKeyframeValueEdit(project: VideoProject, clipId: string, p
|
|
|
1771
2083
|
*/
|
|
1772
2084
|
declare function videoKeyframeToggleEdit(project: VideoProject, clipId: string, property: VideoKeyframeProperty, time: number): VideoEdit | null;
|
|
1773
2085
|
|
|
1774
|
-
export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_FILLERS, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPauseOptions, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoSilenceOptions, type VideoSnapOptions, type VideoSvgOptions, type VideoTextClip, type VideoTimelineWord, type VideoTrack, type VideoTrackKind, type VideoTranscriptRange, type VideoTranscriptWord, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoFillers, findVideoGaps, findVideoTranscriptPauses, findVideoTranscriptText, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, mergeVideoRanges, nextFreeVideoSlot, normalizeVideoGrade, normalizeVideoWord, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTrack, parseVideoTranscript, parseVideoTranscriptWords, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSpeed, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRemoveRangesEdits, videoRulerTicks, videoSnapPoints, videoTextStyle, videoTimecodeFrames, videoTimelineTranscript, videoTitleFrame, videoTrackSyncLocked, videoTranscriptEdit, videoTranscriptTrack, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoWaveformPath, videoWipeRect, videoWordAt, videoWordsRange };
|
|
2086
|
+
export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_FILLERS, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_SCOPE_KINDS, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_VECTORSCOPE_TARGETS, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoExposureOptions, type VideoExposureStats, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoHistogram, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPauseOptions, type VideoPixels, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, VideoPreviewPixels, type VideoPreviewSnapshot, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoScopeImage, type VideoScopeKind, type VideoScopeOptions, type VideoScopeSummary, type VideoScopesPanelReading, type VideoSilenceOptions, type VideoSnapOptions, type VideoSpeedSegment, type VideoSvgOptions, type VideoTextClip, type VideoTimelineWord, type VideoTrack, type VideoTrackKind, type VideoTranscriptRange, type VideoTranscriptWord, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoVectorscope, type VideoWaveform, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, checkVideoTimeRemap, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoFillers, findVideoGaps, findVideoTranscriptPauses, findVideoTranscriptText, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, mergeVideoRanges, nextFreeVideoSlot, normalizeVideoGrade, normalizeVideoWord, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTimeRemap, parseVideoTrack, parseVideoTranscript, parseVideoTranscriptWords, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, readVideoScopesPanel, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, summarizeVideoScopes, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoChroma, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSourceTime, videoClipSpeed, videoClipSpeedAt, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoExposureNotes, videoExposureStats, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoFreezeFrameEdit, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHistogram, videoHistogramImage, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoLuma, videoLumaWaveform, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRemoveRangesEdits, videoRulerTicks, videoScopeImage, videoSlowMotionRamp, videoSnapPoints, videoSpeedRampEdit, videoSpeedRampKeys, videoTextStyle, videoTimeRemapBreakpoints, videoTimeRemapSpan, videoTimecodeFrames, videoTimelineTranscript, videoTitleFrame, videoTrackSyncLocked, videoTranscriptEdit, videoTranscriptTrack, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoVectorscope, videoVectorscopeAngle, videoVectorscopeImage, videoVectorscopePoint, videoWaveformImage, videoWaveformPath, videoWipeRect, videoWordAt, videoWordsRange };
|