@mediaruntime/cli 1.3.0 → 1.5.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/CHANGELOG.md +16 -0
- package/README.md +14 -1
- package/dist/cli.js +184 -8
- package/dist/cli.js.map +1 -1
- package/docs/CLI_SDD.md +13 -0
- package/docs/clipping.md +113 -0
- package/package.json +3 -3
package/docs/CLI_SDD.md
CHANGED
|
@@ -135,12 +135,23 @@ mediaruntime run <source>
|
|
|
135
135
|
(--output <alias> | --preset <public-preset>) [...]
|
|
136
136
|
[--metadata <json-object>]
|
|
137
137
|
[--idempotency-key <key>]
|
|
138
|
+
[--no-webhook]
|
|
138
139
|
[--wait]
|
|
139
140
|
[--timeout-ms <positive-integer>]
|
|
140
141
|
[--download <zip-path>] [--force]
|
|
141
142
|
[--json]
|
|
142
143
|
```
|
|
143
144
|
|
|
145
|
+
When exactly one clipping preset is selected, `run` accepts the controls in
|
|
146
|
+
[the clipping guide](clipping.md). `video_clip_v1` requires explicit `--clip-start`
|
|
147
|
+
and `--clip-duration`; `clip_candidates_v1` accepts duration bounds, suggestion count,
|
|
148
|
+
and repeated keywords. `--clip-transcript` accepts a local JSON plan/segment array,
|
|
149
|
+
SRT, or VTT file with full-source timestamps (at most 1 MiB). Invalid attachments
|
|
150
|
+
fail before job creation. Burned captions are opt-in through `--clip-captions`, which
|
|
151
|
+
requires a transcript. Supplied transcripts bypass analysis transcription; manual
|
|
152
|
+
ranges never require Whisper. Clipping controls cannot ambiguously target multiple
|
|
153
|
+
outputs or a hosted recipe. This additive surface is available in client release 1.4.0.
|
|
154
|
+
|
|
144
155
|
When exactly one `contact_sheet_v1` preset is selected, `run` also accepts bounded
|
|
145
156
|
`--contact-columns`, `--contact-rows`, `--contact-tile-width`,
|
|
146
157
|
`--contact-tile-height`, `--contact-interval`, `--contact-start`,
|
|
@@ -184,6 +195,8 @@ It is parsed locally and rejected before submission if malformed, an array, or a
|
|
|
184
195
|
creates one invocation-scoped key and reuses it only for that invocation's transport
|
|
185
196
|
retries.
|
|
186
197
|
|
|
198
|
+
`--no-webhook` forwards `deliverWebhook: false` through Node SDK 1.5.0 or newer. It applies to aliases, presets, and hosted recipes, and is independent of waiting/downloading. Omission preserves the default account webhook behavior. Billing and retention are unchanged; manual webhook retries cannot override the opt-out.
|
|
199
|
+
|
|
187
200
|
Without `--wait`, the command prints the accepted receipt and exits. `--wait` uses the SDK
|
|
188
201
|
poller until a terminal state. `--timeout-ms` applies to that wait, defaults to `300000`,
|
|
189
202
|
and is invalid without `--wait` or `--download`. `--download` implies `--wait`.
|
package/docs/clipping.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Assisted clipping (1.4.0)
|
|
2
|
+
|
|
3
|
+
Requires CLI and Node SDK 1.4.0 or newer. Earlier versions do not include these
|
|
4
|
+
controls. The gateway and worker must
|
|
5
|
+
also deploy `clip_candidates_v1` and `video_clip_v1`. The live capability catalog
|
|
6
|
+
controls which presets an account can run.
|
|
7
|
+
|
|
8
|
+
## Analyze → review → render
|
|
9
|
+
|
|
10
|
+
Analyze and download the resulting plan using the normal job flow. Choose a minimum
|
|
11
|
+
no longer than the source (the 15-second default does not fit a 12-second video):
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
mediaruntime run https://your-cdn.example/episode.mp4 \
|
|
15
|
+
--preset clip_candidates_v1 --clip-min-duration 15 --clip-max-duration 60 \
|
|
16
|
+
--clip-count 5 --clip-keyword deployment --download analysis.zip
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`--download` implies `--wait`. Extract `clip_candidates.json` from the ZIP, review
|
|
20
|
+
its candidates and transcript, and choose a range. Scores express transcript and
|
|
21
|
+
pause heuristics, not predicted engagement. Analysis produces a JSON report, not
|
|
22
|
+
rendered clips. Empty candidates are a successful result when nothing matches;
|
|
23
|
+
`empty_reason` explains `no_speech`, `no_keyword_match`, `no_matching_ranges`, or
|
|
24
|
+
`source_too_short` when present. A nonempty transcript can still be reused. Current
|
|
25
|
+
preflight rejects a minimum longer than the source before analysis begins.
|
|
26
|
+
|
|
27
|
+
Render the reviewed range from the **same source**:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
mediaruntime run https://your-cdn.example/episode.mp4 \
|
|
31
|
+
--preset video_clip_v1 --clip-start 20 --clip-duration 30 \
|
|
32
|
+
--clip-layout vertical_blur --clip-transcript clip_candidates.json --clip-captions \
|
|
33
|
+
--download clip.zip
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The example needs a source of at least 50 seconds. Replace its start and duration
|
|
37
|
+
with the candidate you reviewed; CLI does not automatically pick or submit a candidate.
|
|
38
|
+
The ZIP includes the MP4, poster, and SRT/VTT sidecars when a transcript intersects
|
|
39
|
+
the range. `--clip-captions` additionally burns that supplied text into the video.
|
|
40
|
+
Omit `--clip-captions` to keep sidecars only.
|
|
41
|
+
|
|
42
|
+
## Manual clips and existing captions
|
|
43
|
+
|
|
44
|
+
Manual clipping requires no transcription or Whisper model:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
mediaruntime run ./source.mp4 --preset video_clip_v1 \
|
|
48
|
+
--clip-start 1 --clip-duration 5 --download manual-clip.zip
|
|
49
|
+
|
|
50
|
+
mediaruntime run ./source.mp4 --preset video_clip_v1 \
|
|
51
|
+
--clip-start 1 --clip-duration 5 --clip-transcript ./source.srt \
|
|
52
|
+
--clip-captions --download captioned-clip.zip
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`--clip-transcript` accepts a **local** `.srt`, `.vtt`, or `.json` file. JSON may
|
|
56
|
+
be a report with `transcript` or a bare segment array. Snake-case API fields
|
|
57
|
+
`start_time_sec` / `end_time_sec` and camel-case Node fields `startTimeSec` /
|
|
58
|
+
`endTimeSec` are accepted with `text`. SRT/VTT styling is flattened into plain text.
|
|
59
|
+
Cloud URLs and storage paths are not transcript file arguments: download the file
|
|
60
|
+
locally first. Main media sources continue to support the usual upload/source flow.
|
|
61
|
+
|
|
62
|
+
Times refer to the **full original source**, not the trimmed clip. Do not subtract
|
|
63
|
+
the clip start; the engine intersects and rebases captions. Burning requires text
|
|
64
|
+
that overlaps the selected range. Text need not describe the content for a rendering
|
|
65
|
+
test, but use accurate transcripts for meaningful speech suggestions.
|
|
66
|
+
|
|
67
|
+
Attachments must be UTF-8, at most 1 MiB, and contain 1–2000 ordered segments.
|
|
68
|
+
Each cue needs a finite start ≥ 0, end > start, and nonblank text of at most
|
|
69
|
+
2000 UTF-8 bytes. Total text is bounded to 256 KiB and timestamps to 604800 seconds.
|
|
70
|
+
Source duration/range validity is checked by gateway/engine preflight.
|
|
71
|
+
|
|
72
|
+
## Controls and processing
|
|
73
|
+
|
|
74
|
+
| Option | Bound/default |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `--clip-start` | Required for render; 0–604800 seconds |
|
|
77
|
+
| `--clip-duration` | Required for render; 0.1–300 seconds, wholly within source |
|
|
78
|
+
| `--clip-layout` | `original` (default) or `vertical_blur` |
|
|
79
|
+
| `--clip-min-duration` | Analysis: 1–300 seconds; default 15 |
|
|
80
|
+
| `--clip-max-duration` | Analysis: 1–300 seconds; default 60; ≥ minimum |
|
|
81
|
+
| `--clip-count` | Analysis: integer 1–20; default 5 |
|
|
82
|
+
| `--clip-keyword` | Analysis: repeat up to 20 times, 1–100 UTF-8 bytes each |
|
|
83
|
+
| `--clip-transcript` | Local JSON/SRT/VTT attachment for either clipping preset |
|
|
84
|
+
| `--clip-captions` | Render only; opt-in burn, requires transcript |
|
|
85
|
+
|
|
86
|
+
Clipping controls require exactly one corresponding `--preset`; they cannot be
|
|
87
|
+
combined with a hosted recipe or ambiguously target multiple outputs.
|
|
88
|
+
|
|
89
|
+
Analysis is Premium. Without supplied text it uses the worker's **existing Whisper
|
|
90
|
+
base model**, which must be available in that runtime. Supplying `--clip-transcript`
|
|
91
|
+
for analysis bypasses Whisper. This feature introduces no additional ML model.
|
|
92
|
+
Standard renders cap original framing at a 1920-pixel long edge and 30 fps;
|
|
93
|
+
vertical blur-fill uses 720×1280 at up to 30 fps. Account settings may select a
|
|
94
|
+
higher effective tier. Premium analysis depends on the deployment's Sandbox
|
|
95
|
+
configuration; use a funded account when that Sandbox disables Premium processing.
|
|
96
|
+
|
|
97
|
+
## Local release verification
|
|
98
|
+
|
|
99
|
+
Build and pack the sibling Node SDK 1.4.0 first, then install its tarball only for
|
|
100
|
+
local verification, keeping the committed dependency as `^1.4.0`:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
npm install --offline --no-save --package-lock=false /path/to/mediaruntime-node-1.4.0.tgz
|
|
104
|
+
npm run check
|
|
105
|
+
npm test
|
|
106
|
+
node dist/cli.js --version
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The CLI checks that its SDK supports clipping before submission. Do not publish a
|
|
110
|
+
filesystem dependency. After publishing the SDK, regenerate the CLI lock with
|
|
111
|
+
`npm install --package-lock-only`, run a clean `npm ci` and package smoke test, then
|
|
112
|
+
publish the CLI. Registry publication and deployed-service verification are separate
|
|
113
|
+
release steps; passing local tests does not assert they have happened.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediaruntime/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Official command-line client for MediaRuntime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"prepack": "npm run check && npm test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
34
|
+
"@mediaruntime/node": "^1.5.0",
|
|
35
|
+
"@napi-rs/keyring": "^1.3.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^24.3.0",
|