@pixerate/editor 0.83.0 → 0.85.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.83.0",
3
+ "version": "0.85.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -38,12 +38,17 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
38
38
  `slip_video_clip` (change what a shot shows), `slide_video_clip` (move a shot between its
39
39
  neighbours); for a whole stretch, `split_video_at`, `lift_video_range` or
40
40
  `extract_video_range`. Animate opacity, volume or position with `set_video_keyframes`.
41
- 6. **Check.** `check_video_project` and fix every error and warning; `find_video_gaps` for
41
+ 6. **Cut by text** when the media has speech: `set_video_transcript` for each spoken asset (or
42
+ check `transcriptWords` in `get_video_project`), `get_video_transcript` to read the edit, then
43
+ `find_video_fillers`, `find_video_pauses` or `find_video_transcript_text` and pass the ranges
44
+ you want gone to `remove_video_ranges` in one call. Re-read the transcript afterwards: every
45
+ time after a cut has moved.
46
+ 7. **Check.** `check_video_project` and fix every error and warning; `find_video_gaps` for
42
47
  unintended black or silence.
43
- 7. **Look and listen.** `get_video_frame` at cuts and transitions for layers and audio gains as
48
+ 8. **Look and listen.** `get_video_frame` at cuts and transitions for layers and audio gains as
44
49
  numbers; `render_video_frame` with `times` for a contact sheet of the sequence. Render
45
50
  after a batch, not after every edit.
46
- 8. **Export** when asked: `export_video_ffmpeg` (a command to run, not a render) or
51
+ 9. **Export** when asked: `export_video_ffmpeg` (a command to run, not a render) or
47
52
  `export_video_edl` (one track) for finishing elsewhere. Read the returned notes. For a
48
53
  delivery loudness, have the host run `export_video_loudness_measure` first and pass what it
49
54
  prints as `loudness.measured`; one pass (`loudness` without `measured`) is fine for a draft.
@@ -62,8 +67,9 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
62
67
  dialogue and scene changes.
63
68
  - **Transitions sparingly.** A straight cut is the default. Use `crossfade` for passage of time
64
69
  or a soft scene change, `dip` (to black, or a `color`) for a section break, `wipe` rarely.
65
- Keep them short (300-1000 ms). Crossfades and wipes need handles: half the duration of
66
- unused media past the cut on both clips; `dip` needs none.
70
+ Keep them short (300-1000 ms). `push` and `slide` suit graphics, montages and social edits
71
+ more than drama; `iris` is a stylised period or comic effect. Every type but `dip` needs
72
+ handles: half the duration of unused media past the cut on both clips; `dip` needs none.
67
73
  - **Insert vs overwrite.** `add_video_clip` and `move_video_clip` take `mode`: `refuse`
68
74
  (default; the error names the next free place), `overwrite` (replace what is underneath, like
69
75
  an overwrite edit) or `insert` (push later material along). Use `ripple: true` on trim and
@@ -78,6 +84,10 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
78
84
  - **Keyframes sparingly.** Use `set_video_keyframes` for a push-in (`scale` 1 to 1.1 over the
79
85
  shot), a duck under dialogue (`volume`), or a fade that is not at an edge; ease (`ease-in-out`)
80
86
  rather than linear for motion. Simple fades at the clip edges are `fadeIn` / `fadeOut`.
87
+ - **Tighten dialogue by text first.** With a transcript, remove fillers and pauses with the find
88
+ tools and one `remove_video_ranges`; review the fillers list first (a "you know" can be
89
+ meant). Keep 150-300 ms around words (`keep`) so speech breathes. Without a transcript, use the
90
+ sound itself, below.
81
91
  - **Tighten dialogue by ear, in numbers.** `find_video_silences` on an interview or voiceover clip
82
92
  lists the pauses in timeline time; extract the long ones (keep 150-300 ms either side so speech
83
93
  does not sound clipped: shrink each range before `extract_video_range`, and extract from the
@@ -92,12 +102,24 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
92
102
  `volume` multiply. Give every audio clip that starts or ends mid-sound a short `fadeIn` /
93
103
  `fadeOut` (10-50 ms) to avoid clicks; fade music beds over 1-3 s. Shape sound fades with
94
104
  `fadeInCurve` / `fadeOutCurve`: `equal-power` where two sounds overlap (it keeps loudness
95
- steady, where linear dips in the middle), `exponential` to fade music out to silence
105
+ steady, where linear dips in the middle; transitions' `audioCurve` already defaults to it for
106
+ crossfades and wipes), `exponential` to fade music out to silence
96
107
  naturally, `s-curve` for a gentle start and finish. Linear is the default.
97
108
  - **Delivery loudness.** Normalise the final mix rather than pushing clip volumes: -14 LUFS for
98
109
  web and streaming, -16 for podcasts, -23 (EBU R128) or -24 (ATSC) for broadcast, with true
99
110
  peaks at or under -1 dBTP. Two passes keep the dynamics; one pass rides the level.
100
- - **Titles.** Keep text inside the title-safe area (about 90% of the frame), hold it at least as
111
+ - **Grade in two passes: correct, then look.** First balance each shot so a scene matches
112
+ (`update_video_clip` `grade`: fix exposure and white balance against the best shot, then
113
+ `copy_video_grade` from it to the rest of the scene), then add a look with
114
+ `apply_video_grade_preset` at a modest `amount` (0.3-0.6). Check with `render_video_frame` at a
115
+ few times side by side. Skin tones are the reference: avoid strong `hue` or `tint` on people.
116
+ - **Blend overlays, don't key them.** Light leaks, flares, film burns and glows shot on black go on
117
+ a higher video track with `blend: "screen"` (or `add` for a hotter look), so the black drops
118
+ out; textures, paper and dust on white use `multiply`. Lower the clip's `opacity` to taste.
119
+ A blend affects everything beneath the clip on lower tracks.
120
+ - **Titles.** Bring titles in and out with `animateIn` / `animateOut` rather than hand-made
121
+ keyframes: `rise` or `fade` for lower thirds, `pop` for a playful callout, `zoom` for a slow
122
+ reveal; 300-600 ms in, a little quicker out. Keep text inside the title-safe area (about 90% of the frame), hold it at least as
101
123
  long as it takes to read twice, and use `background` for contrast over busy footage.
102
124
  - **Pacing.** Vary shot length with content; trim heads and tails of every clip to the
103
125
  essential action rather than using whole source files.
@@ -112,6 +134,10 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
112
134
  | --- | --- |
113
135
  | `get_video_project` | Start here. Returns frame size, fps, length (ms), assets (id, kind, src, duration), tracks top to bottom with each clip in time order (id, type, start, duration, end, source in/out, fades, transition), markers, playhead, selection, issues and whether it can be edited. |
114
136
  | `get_video_frame` | Inspect a `time` (ms) as data: pictures back to front (clip, track, asset, source time, opacity, placement rect, rotation, wipe) and sounds (clip, source time, gain after volumes, fades and transitions). Use to verify a cut, layer order or J/L cut without images. |
137
+ | `get_video_transcript` | Read what the timeline says on one `track` (default: the first audio track with transcribed media): the text, and each word with its timeline `start` / `end` ms and `clip`. `from` / `to` narrow it; `limit` (default 1000) with `more`. Words cut out of the edit are not listed. |
138
+ | `find_video_transcript_text` | Find every place a word or phrase (`query`, case and punctuation ignored) is said, as `{ from, to, text }` timeline ranges for `remove_video_ranges`, `split_video_at` or `seek_video`. |
139
+ | `find_video_fillers` | Find filler words (um, uh, erm, you know, I mean…; or your own `fillers`) as timeline ranges, longest phrase first, with their `total` ms. Review before cutting. |
140
+ | `find_video_pauses` | Find gaps between words longer than `min` (default 700 ms), less `keep` (default 150 ms) next to each word, snapped inward to frames, as timeline ranges with their `total`. |
115
141
  | `find_video_gaps` | List empty stretches between clips (and before the first) as `{ track, start, end }` ms, on every track or one `track`. Then `close_video_gaps` or ripple. |
116
142
  | `check_video_project` | After every batch and before export. Lists issues errors first with a code (`missing-asset`, `wrong-track`, `overlap`, `source-overrun`, `transition-without-cut`, `transition-too-long`, `transition-handles`, `fades-too-long`, `unknown-duration`, `unused-asset`, `marker-past-end`, `empty`), what it is about and how to fix it. |
117
143
  | `render_video_frame` | Look at the picture at `time`, or at 2-16 `times` as one labelled contact sheet (`columns` 1-8). SVG by default; `format: "png"` only when the host can rasterize. Video without a `poster` shows as a labelled box with its source timecode. |
@@ -126,6 +152,8 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
126
152
  | `get_video_audio_levels` | Measure a media `clip`'s source sound (timeline times) or an `asset`'s (source times) between `from` and `to`: peak dBFS in each of `buckets` (default 50, up to 500) equal stretches, and the loudest peak. Levels are the recording before clip volume and fades. Use it to find where speech or a beat starts or to judge loudness. The first call for an asset decodes its file. |
127
153
  | `find_video_silences` | List stretches of a `clip` or `asset` that stay below `thresholdDb` (default -40) for at least `minDuration` ms (default 300). For a clip the `{ start, end }` are timeline times that go straight into `extract_video_range` (cut a pause, closing up) or `split_video_at`. |
128
154
  | `seek_video` | Show the person a moment: `time`, a `clip`'s start or a `marker`, with `play` true or false. Does not change the project. Returns the playhead and clips under it. |
155
+ | `set_video_transcript` | Attach what is said in a video or audio `asset`: `text` (a Whisper JSON, .srt or .vtt file's contents) or `words` (`[{ word, start, end }]` ms of the source). Captions give approximate word timings. Returns the word count and first and last words. Clear it with `update_video_asset` `remove: ["transcript"]`. |
156
+ | `remove_video_ranges` | Cut `ranges` (`[{ from, to }]` timeline ms, as the find tools return them) out and close them up on every sync-locked track, as one undo step: merged where they touch, extracted last first. Returns how many stretches and how much time went, and the new length. |
129
157
  | `set_video_settings` | Set `name`, `width` / `height` (pixels, 16-8192), `fps` (e.g. 24, 25, 30, 60) or `background` colour. One undo step. |
130
158
  | `add_video_asset` | Register a file: `kind` (video, audio, image), `src` (URL, path or data URL), `duration` ms (required in practice for video and audio), optional `id`, `name`, `width`, `height`, `hasAudio` (default true for video), `poster`. Returns the asset id. |
131
159
  | `update_video_asset` | Relink or correct an asset via `set` (src, name, duration, size, hasAudio, poster) and `remove`. Refused if clips would then run past its end. |
@@ -145,10 +173,12 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
145
173
  | `lift_video_range` | Empty `from`..`to` ms on all unlocked tracks or the given `tracks`, leaving a gap: clips inside are deleted, clips across an edge trimmed, a clip across both cut in two. Returns what was removed, trimmed and created. |
146
174
  | `extract_video_range` | Remove `from`..`to` ms and close it up: as lift, then later material moves earlier on those and every sync-locked track. Refused (naming the clip) when a sync-locked track outside `tracks` has material there. Use to cut a section out of a finished sequence. |
147
175
  | `delete_video_clips` | Remove `clips`; `ripple: true` pulls later clips up to close the gaps (a ripple delete). |
148
- | `update_video_clip` | Change properties via `set`: opacity, transform (`x`, `y` px from centre, `scale`, `rotation`), `fit` (contain default for media, cover, fill, none), `fadeIn` / `fadeOut`, name; media `volume` (0-4), `muted`, `fadeInCurve` / `fadeOutCurve` (the sound's fade shape: linear, equal-power, s-curve, exponential, logarithmic), `speed` (0.05-20, keeps the source range so the length changes), `asset`; title text and style; colour. `remove` resets to defaults. Not for timing. |
176
+ | `update_video_clip` | Change properties via `set`: opacity, transform (`x`, `y` px from centre, `scale`, `rotation`), `fit` (contain default for media, cover, fill, none), `animateIn` / `animateOut` (`{ effect: fade, rise, drop, slide-left, slide-right, zoom or pop, duration ms default 500 }`), `grade` (`exposure` stops -3-3, `contrast`, `saturation`, `temperature`, `tint` -1-1, `hue` degrees; replaces the whole grade), `blend` (normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, add), `fadeIn` / `fadeOut`, name; media `volume` (0-4), `muted`, `fadeInCurve` / `fadeOutCurve` (the sound's fade shape: linear, equal-power, s-curve, exponential, logarithmic), `speed` (0.05-20, keeps the source range so the length changes), `asset`; title text and style; colour. `remove` resets to defaults. Not for timing. |
177
+ | `apply_video_grade_preset` | Give `clips` (on video tracks) a named look at an `amount` 0-1 (default 1), replacing their grades: warm, cool, punchy, faded, black-and-white, bleach-bypass, day-for-night. One undo step; returns each clip's grade to fine-tune with `update_video_clip`. |
178
+ | `copy_video_grade` | Match shots: give the `to` clips the grade of the `from` clip (one undo step; a source with no grade clears theirs). Returns the grade copied. |
149
179
  | `set_video_keyframes` | Animate one `property` of a `clip` (`opacity` 0-1, `volume` 0-4 for media, `x` / `y` px from centre, `scale`, `rotation` degrees) with `keys` `[{ t, v, ease? }]`, replacing its keys. `t` is clip time (ms from the clip's start), so keys travel with the clip. `ease`: linear (default), hold, ease-in, ease-out, ease-in-out or cubic-bezier points. Returns the sorted keys. |
150
180
  | `remove_video_keyframes` | Remove all keys of a clip `property`, leaving the value it had at the clip's start. |
151
- | `set_video_transition` | Set the transition into a `clip` from the clip ending where it starts on the same track: `{ type: crossfade, dip or wipe, duration ms centred on the cut, color (dip, default black), direction (wipe, default right) }`, or `null` to remove. When handles are short the error gives the longest that fits. |
181
+ | `set_video_transition` | Set the transition into a `clip` from the clip ending where it starts on the same track: `{ type: crossfade, dip, wipe, push, slide or iris, duration ms centred on the cut, color (dip, default black), direction (wipe, push, slide; default right), audioCurve (the sound's fades: equal-power by default for crossfade and wipe, linear for dip) }`, or `null` to remove. When handles are short the error gives the longest that fits. |
152
182
  | `close_video_gaps` | Slide clips on a `track` earlier so no gaps remain, from time `from` (default the start). Returns the clips that moved. |
153
183
  | `add_video_marker` | Add a marker at `time` with `label`, `color` and optional `id`, for beats, sections or review notes. Returns its id. |
154
184
  | `remove_video_marker` | Remove a `marker` by id. |
@@ -162,11 +192,16 @@ For errors, namespaced tool names and undo conventions, see `pixerate-agent-tool
162
192
  impossible transition is refused whole (unless you asked for `mode: "overwrite"` or
163
193
  `"insert"`); read the message (it names the next free place or the longest trim /
164
194
  transition that fits) and retry with those numbers.
195
+ - **Animations write keyframes for you.** `animateIn` / `animateOut` move opacity, x, y and scale;
196
+ if the clip keys one of those itself, the animation leaves it alone (`animation-keyed`), and
197
+ entrance plus exit longer than the clip are shortened (`animations-too-long`).
165
198
  - **Numbers replace keyframes.** Setting `opacity` or `volume` as a plain
166
199
  number (in `add_video_clip` or `update_video_clip`) drops that property's keys; animate with
167
200
  `set_video_keyframes` after the static settings, not before.
168
201
  - **Slip, slide and roll clamp.** They move as far as the media allows and say how far in
169
202
  `delta`; check it instead of assuming the full amount was applied.
203
+ - **Times move after a cut.** Ranges from the find tools are valid for the timeline as it was;
204
+ pass them all to one `remove_video_ranges` (it cuts last first), or find again after each cut.
170
205
  - **`edit_video` has no result references.** Unlike `edit_animation`, ops cannot say `$0.id`;
171
206
  set clip, track and marker ids yourself when later ops in the batch need them.
172
207
  - **`edit_video` op shapes differ slightly** from the single tools: `add_asset` wraps the asset