@nodaro/cli 1.48.0 → 1.50.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/README.md +2 -2
- package/dist/index.js +104 -18
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ Generate an API token at `https://app.nodaro.ai/settings/api`, then save it:
|
|
|
63
63
|
```bash
|
|
64
64
|
nodaro auth login # interactive prompt
|
|
65
65
|
nodaro auth login --token "$NODARO_TOKEN" # non-interactive
|
|
66
|
-
nodaro auth login --profile staging --base-url https://next.nodaro.ai
|
|
66
|
+
nodaro auth login --profile staging --base-url https://next.app.nodaro.ai
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
The token is stored at `~/.config/nodaro/config.json` with `chmod 0600`. Override the location with `NODARO_CONFIG_DIR`.
|
|
@@ -79,7 +79,7 @@ Switch between staging / prod / local instances with `--profile`:
|
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
81
|
nodaro auth login --profile prod --base-url https://app.nodaro.ai
|
|
82
|
-
nodaro auth login --profile staging --base-url https://next.nodaro.ai
|
|
82
|
+
nodaro auth login --profile staging --base-url https://next.app.nodaro.ai
|
|
83
83
|
nodaro auth login --profile local --base-url http://localhost:8000
|
|
84
84
|
|
|
85
85
|
nodaro projects list --profile staging
|
package/dist/index.js
CHANGED
|
@@ -11,16 +11,16 @@ import { randomBytes } from 'crypto';
|
|
|
11
11
|
import { spawn } from 'child_process';
|
|
12
12
|
import { createClient, StaticTokenAuth, CallbackAuth } from '@nodaro/sdk/client';
|
|
13
13
|
import { ContinuationPreviewPendingError, UnauthorizedError, NodaroError, AppRunVersionChangedError, AlreadyRunningError, ContinuationRefusedError } from '@nodaro/sdk/errors';
|
|
14
|
-
import { collectionRecordHeadline, PREVIEW_RENDER_NODE_TYPES, isPreviewRefusalCode, parseNodePresetExport } from '@nodaro/shared/nodes';
|
|
14
|
+
import { transcribeTranslationRefusal, collectionRecordHeadline, PREVIEW_RENDER_NODE_TYPES, isPreviewRefusalCode, parseNodePresetExport } from '@nodaro/shared/nodes';
|
|
15
15
|
import select from '@inquirer/select';
|
|
16
16
|
import checkbox from '@inquirer/checkbox';
|
|
17
17
|
import input from '@inquirer/input';
|
|
18
18
|
import { CHARACTER_STYLES } from '@nodaro/shared/entities';
|
|
19
|
-
import { TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities,
|
|
19
|
+
import { TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities, CAPTION_TRANSCRIBE_LANES, DEFAULT_TRANSCRIBE_PROVIDER, TRANSCRIBE_TARGET_LANGUAGES } from '@nodaro/shared/models';
|
|
20
20
|
import { VOICE_FAVORITE_TYPES } from '@nodaro/shared/pipeline';
|
|
21
21
|
import { OVERLAY_ANCHORS, OVERLAY_PLATFORM_IDS, GENERATE_MASK_LIMITS, DEFAULT_VIDEO_MASK_PROVIDER, VIDEO_MASK_PROVIDERS, VIDEO_MASK_LIMITS, MASK_COMPOSITE_BOUNDS, MASK_COMPOSITE_DEFAULTS, MASK_COMPOSITE_BACKGROUND_FITS, MASK_COMPOSITE_AUDIO_SOURCES, MASK_COMPOSITE_FILLS } from '@nodaro/shared/media';
|
|
22
22
|
import { ALL_CAPTION_STYLES, DEFAULT_CAPTION_LOOK, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MIN, CAPTION_MAX_WORDS_PER_LINE_MAX, SUPPORTED_FONT_NAMES } from '@nodaro/shared/captions';
|
|
23
|
-
import { VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_OUTPUT_ASPECTS, isVideoOverlayPresetId, isVideoOverlayCorner, isVideoOverlayOutputAspect, VIDEO_OVERLAY_FITS } from '@nodaro/shared/video';
|
|
23
|
+
import { VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_OUTPUT_ASPECTS, VIDEO_OVERLAY_LAYOUT_IDS, isVideoOverlayPresetId, isVideoOverlayCorner, isVideoOverlayOutputAspect, VIDEO_OVERLAY_FITS, isVideoOverlayLayoutId } from '@nodaro/shared/video';
|
|
24
24
|
import { SOCIAL_PLATFORMS, COMPETITOR_ACCOUNT_KEYS, isMeasurableCard, isSocialPost, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_SCHEDULES } from '@nodaro/shared/social';
|
|
25
25
|
import { RECAST_SEGMENT_PACKS } from '@nodaro/shared/apps';
|
|
26
26
|
import { LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS } from '@nodaro/sdk/locations';
|
|
@@ -42,7 +42,7 @@ var require_package = __commonJS({
|
|
|
42
42
|
"package.json"(exports$1, module) {
|
|
43
43
|
module.exports = {
|
|
44
44
|
name: "@nodaro/cli",
|
|
45
|
-
version: "1.
|
|
45
|
+
version: "1.50.0",
|
|
46
46
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
47
47
|
type: "module",
|
|
48
48
|
license: "Apache-2.0",
|
|
@@ -83,11 +83,11 @@ var require_package = __commonJS({
|
|
|
83
83
|
"@inquirer/confirm": "^6.0.12",
|
|
84
84
|
"@inquirer/input": "^5.0.12",
|
|
85
85
|
"@inquirer/select": "^5.1.4",
|
|
86
|
-
"@nodaro/sdk": "^2.
|
|
87
|
-
"@nodaro/shared": "^3.
|
|
86
|
+
"@nodaro/sdk": "^2.70.0",
|
|
87
|
+
"@nodaro/shared": "^3.63.0",
|
|
88
88
|
commander: "^12.1.0",
|
|
89
89
|
picocolors: "^1.1.1",
|
|
90
|
-
"@nodaro/prompts": "^1.
|
|
90
|
+
"@nodaro/prompts": "^1.55.0"
|
|
91
91
|
},
|
|
92
92
|
devDependencies: {
|
|
93
93
|
tsup: "^8.5.0",
|
|
@@ -414,7 +414,7 @@ function saveWorkspace(profileName, workspaceId) {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// src/client.ts
|
|
417
|
-
var CLI_VERSION = "1.
|
|
417
|
+
var CLI_VERSION = "1.50.0" ;
|
|
418
418
|
function buildPublicClient(opts = {}) {
|
|
419
419
|
const { profile } = getProfile(opts.profile);
|
|
420
420
|
return createClient({
|
|
@@ -3163,6 +3163,9 @@ Examples:
|
|
|
3163
3163
|
cmd.addCommand(clones);
|
|
3164
3164
|
return cmd;
|
|
3165
3165
|
}
|
|
3166
|
+
var SPLIT_LAYERS_SIZES = ["1K", "1.5K", "2K", "auto"];
|
|
3167
|
+
var SPLIT_LAYERS_MAX_LAYERS = { min: 1, max: 99, default: 9 };
|
|
3168
|
+
var SPLIT_LAYERS_PROMPT_MAX = 2e3;
|
|
3166
3169
|
function parseSection(raw) {
|
|
3167
3170
|
const m = raw.match(/^([0-9]+(?:\.[0-9]+)?)-([0-9]+(?:\.[0-9]+)?)$/);
|
|
3168
3171
|
const start = m ? parseFloat(m[1]) : NaN;
|
|
@@ -3215,6 +3218,20 @@ function readJsonArrayFile(path, flag) {
|
|
|
3215
3218
|
}
|
|
3216
3219
|
return parsed;
|
|
3217
3220
|
}
|
|
3221
|
+
function parseJsonObjectFlag(raw, flag) {
|
|
3222
|
+
let parsed;
|
|
3223
|
+
try {
|
|
3224
|
+
parsed = JSON.parse(raw);
|
|
3225
|
+
} catch (err) {
|
|
3226
|
+
warn(`${flag} must be a JSON object, e.g. '{"anchor":"bottom","width":100}': ${err.message}`);
|
|
3227
|
+
process.exit(1);
|
|
3228
|
+
}
|
|
3229
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
3230
|
+
warn(`${flag} must be a JSON object, e.g. '{"anchor":"bottom","width":100}' (got ${raw})`);
|
|
3231
|
+
process.exit(1);
|
|
3232
|
+
}
|
|
3233
|
+
return parsed;
|
|
3234
|
+
}
|
|
3218
3235
|
function parseSafeArea(raw) {
|
|
3219
3236
|
const parts = raw.split(",").map((n) => parseFloat(n.trim()));
|
|
3220
3237
|
if (parts.length !== 4 || parts.some((n) => !Number.isFinite(n) || n < 0 || n > 1)) {
|
|
@@ -3236,7 +3253,7 @@ function parseVideoMaskZone(raw) {
|
|
|
3236
3253
|
}
|
|
3237
3254
|
function mediaCommand() {
|
|
3238
3255
|
const cmd = new Command("media").description(
|
|
3239
|
-
"media ingestion + compositing \u2014 pull a social video into storage, trim video/audio, burn captions, still-to-video, slideshow, collage images, overlay layers on an image or timed images on a video, save a URL to storage, probe metadata"
|
|
3256
|
+
"media ingestion + compositing \u2014 pull a social video into storage, trim video/audio, burn captions, still-to-video, slideshow, collage images, overlay layers on an image or timed images and videos on a video, save a URL to storage, probe metadata"
|
|
3240
3257
|
);
|
|
3241
3258
|
cmd.command("download <url>").description("download the video behind a link (the video's page, or a direct video file link) into your storage").option("--max-height <px>", "cap the resolution (e.g. 720); omit for best available", (v) => parseInt(v, 10)).option("--section <a-b>", 'fetch ONLY this time range in seconds (e.g. "30-90"); the cut lands on keyframes, so pad and trim after').option("--watch", "stream the download's live progress until it completes").option("--profile <name>").option("--json").addHelpText("after", `
|
|
3242
3259
|
Examples:
|
|
@@ -3478,7 +3495,7 @@ Examples:
|
|
|
3478
3495
|
).option("--animate", "animate per-word motion on the kinetic styles (the default)").option(
|
|
3479
3496
|
"--no-animate",
|
|
3480
3497
|
"freeze per-word motion on the kinetic styles \u2014 keeps grouping, line-holding and the spoken-word highlight (kinetic styles only)"
|
|
3481
|
-
).option("--no-auto-transcribe", "do NOT transcribe the video's audio when no --text / --captions-file is given").option("--transcribe-provider <name>", `engine for the auto-transcription: ${
|
|
3498
|
+
).option("--no-auto-transcribe", "do NOT transcribe the video's audio when no --text / --captions-file is given").option("--transcribe-provider <name>", `engine for the auto-transcription: ${CAPTION_TRANSCRIBE_LANES.join(" | ")}`).option(
|
|
3482
3499
|
"--segments-file <path>",
|
|
3483
3500
|
"JSON array of caption SEGMENTS \u2014 non-overlapping { startMs, endMs } ranges, each with its own style/look/position overrides and optional own words"
|
|
3484
3501
|
).option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
@@ -3523,8 +3540,8 @@ Examples:
|
|
|
3523
3540
|
warn(`--font-weight must be 100-900 in steps of 100 (got "${opts.fontWeight}")`);
|
|
3524
3541
|
process.exit(1);
|
|
3525
3542
|
}
|
|
3526
|
-
if (opts.transcribeProvider && !
|
|
3527
|
-
warn(`--transcribe-provider must be one of ${
|
|
3543
|
+
if (opts.transcribeProvider && !CAPTION_TRANSCRIBE_LANES.includes(opts.transcribeProvider)) {
|
|
3544
|
+
warn(`--transcribe-provider must be one of ${CAPTION_TRANSCRIBE_LANES.join(", ")} (got "${opts.transcribeProvider}")`);
|
|
3528
3545
|
process.exit(1);
|
|
3529
3546
|
}
|
|
3530
3547
|
const maxWordsPerLine = opts.maxWordsPerLine !== void 0 ? parseMaxWordsPerLine(opts.maxWordsPerLine) : void 0;
|
|
@@ -3739,17 +3756,24 @@ vision model and answers in these same units.`).action(
|
|
|
3739
3756
|
}
|
|
3740
3757
|
}
|
|
3741
3758
|
);
|
|
3742
|
-
cmd.command("video-overlay <videoUrl> [layerUrls...]").description("place timed image layers over a video (local compositor, no AI
|
|
3759
|
+
cmd.command("video-overlay <videoUrl> [layerUrls...]").description("place timed image or video layers over a video (local compositor, no AI) \u2014 positional URLs are image layers, one --at each; video layers come from --layers-file").option("--at <start[-end]>", `a positional layer's window in seconds ("3" = from 3 s to the end, "1.2-2.6"); repeat once per layer, in order`, collectVariadic).option("--preset <id>", `placement for every positional layer: ${VIDEO_OVERLAY_PRESET_IDS.join(" | ")} (default: a corner badge \u2014 bottom-right, or the --corner given)`).option("--corner <corner>", `with --preset corner-badge: ${VIDEO_OVERLAY_CORNERS.join(" | ")} (default bottom-right)`).option("--layers-file <path>", "JSON file with the full layers array \u2014 image or video layers, custom boxes, opacity, animate, zIndex, a video layer's sound (mutually exclusive with positional layer URLs)").option("--aspect <ratio>", `render onto a ${VIDEO_OVERLAY_OUTPUT_ASPECTS.join(" | ")} canvas instead of the video's own size`).option("--base-fit <fit>", "with --aspect: how the video fills the canvas, cover (default) or contain").option("--background-color <hex>", "with --aspect: the padding colour under --base-fit contain, #RRGGBB").option("--layout <id>", `a named layout that places the base, the first video layer or both: ${VIDEO_OVERLAY_LAYOUT_IDS.join(" | ")} (all but pip need --aspect)`).option("--base-box <json>", `with --aspect: where the base video sits, as a layer box, e.g. '{"anchor":"bottom","width":100}'`).option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
3743
3760
|
Examples:
|
|
3744
3761
|
$ nodaro media video-overlay https://x/clip.mp4 https://x/shot1.png https://x/shot2.png --at 1.2-2.6 --at 3-4.4 --preset card --watch
|
|
3745
3762
|
$ nodaro media video-overlay https://x/clip.mp4 https://x/logo.png --at 0 --preset corner-badge --corner top-right --watch
|
|
3746
3763
|
$ nodaro media video-overlay https://x/clip.mp4 --layers-file layers.json --aspect 9:16 --watch
|
|
3764
|
+
$ nodaro media video-overlay https://x/talk.mp4 https://x/card.png --at 0 --aspect 9:16 --layout video-bottom --watch
|
|
3765
|
+
$ nodaro media video-overlay https://x/main.mp4 --layers-file guest.json --layout pip --watch
|
|
3747
3766
|
|
|
3748
3767
|
A layers file holds the API's layers array, e.g.
|
|
3749
3768
|
[{"imageUrl":"https://x/logo.png","start":0,"anchor":"top-left","x":4,"y":4,"width":12,"opacity":0.9}]
|
|
3769
|
+
A video layer takes "videoUrl" instead of "imageUrl" (at most 2 per run); its
|
|
3770
|
+
sound is off unless it sets "sound", e.g. guest.json:
|
|
3771
|
+
[{"videoUrl":"https://x/guest.mp4","start":0,"corner":"top-right","sound":{"volume":0.8}}]
|
|
3750
3772
|
Placement is in PERCENT of the output frame. An explicit box field overrides a
|
|
3751
3773
|
preset; a layer with neither is a corner badge (bottom-right, or the corner it
|
|
3752
|
-
names)
|
|
3774
|
+
names). Layouts: video-bottom / video-top put the base video whole against that
|
|
3775
|
+
edge; stack-whole / stack-filled put it above the first video layer (whole, or
|
|
3776
|
+
each cropped to half the frame); pip puts the first video layer in its corner.`).action(
|
|
3753
3777
|
async (videoUrl, layerUrls, opts) => {
|
|
3754
3778
|
try {
|
|
3755
3779
|
if (opts.layersFile && layerUrls.length > 0) {
|
|
@@ -3784,6 +3808,15 @@ names).`).action(
|
|
|
3784
3808
|
warn("--base-fit and --background-color need --aspect");
|
|
3785
3809
|
process.exit(1);
|
|
3786
3810
|
}
|
|
3811
|
+
if (opts.layout && !isVideoOverlayLayoutId(opts.layout)) {
|
|
3812
|
+
warn(`--layout must be one of ${VIDEO_OVERLAY_LAYOUT_IDS.join(", ")} (got "${opts.layout}")`);
|
|
3813
|
+
process.exit(1);
|
|
3814
|
+
}
|
|
3815
|
+
const baseBox = opts.baseBox !== void 0 ? parseJsonObjectFlag(opts.baseBox, "--base-box") : void 0;
|
|
3816
|
+
if (baseBox && !opts.aspect) {
|
|
3817
|
+
warn("--base-box needs --aspect");
|
|
3818
|
+
process.exit(1);
|
|
3819
|
+
}
|
|
3787
3820
|
let layers;
|
|
3788
3821
|
if (opts.layersFile) {
|
|
3789
3822
|
layers = readJsonArrayFile(opts.layersFile, "--layers-file");
|
|
@@ -3806,7 +3839,10 @@ names).`).action(
|
|
|
3806
3839
|
layers,
|
|
3807
3840
|
...opts.aspect ? { outputAspect: opts.aspect } : {},
|
|
3808
3841
|
...opts.baseFit ? { baseFit: opts.baseFit } : {},
|
|
3809
|
-
...opts.backgroundColor ? { backgroundColor: opts.backgroundColor } : {}
|
|
3842
|
+
...opts.backgroundColor ? { backgroundColor: opts.backgroundColor } : {},
|
|
3843
|
+
...opts.layout ? { layout: opts.layout } : {},
|
|
3844
|
+
// The box's fields go as given; the route fills x, y and fit and refuses a partial or out-of-range box.
|
|
3845
|
+
...baseBox ? { baseBox } : {}
|
|
3810
3846
|
});
|
|
3811
3847
|
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video overlay" });
|
|
3812
3848
|
} catch (err) {
|
|
@@ -3837,6 +3873,44 @@ image, passed through unchanged): \`nodaro jobs get <jobId>\`. Use the mask for
|
|
|
3837
3873
|
handleError(err);
|
|
3838
3874
|
}
|
|
3839
3875
|
});
|
|
3876
|
+
cmd.command("split-layers <imageUrl>").description("split one image into a base picture and separate layers \u2014 each element on its own transparent PNG, with its name, stacking order and the box it sits in on the base").option("--max-layers <n>", `the most layers to make, ${SPLIT_LAYERS_MAX_LAYERS.min}\u2013${SPLIT_LAYERS_MAX_LAYERS.max} (default ${SPLIT_LAYERS_MAX_LAYERS.default}); more elements than that merge into fewer layers`, (v) => Number(v)).option("--size <size>", `each image's pixel budget: ${SPLIT_LAYERS_SIZES.join(" | ")} (default 1K; auto keeps the picture's own size, between 1K and 2K)`).option("--prompt <text>", `what to separate, up to ${SPLIT_LAYERS_PROMPT_MAX.toLocaleString("en-US")} characters (default: the main elements are found automatically)`).option("--session <id>", "a generation session of yours to file the job in").option("--idempotency-key <key>", "sent as Idempotency-Key: a retry with the same key answers the job already started").option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
3877
|
+
Examples:
|
|
3878
|
+
$ nodaro media split-layers https://x/poster.png --watch
|
|
3879
|
+
$ nodaro media split-layers https://x/poster.png --max-layers 4 --size 2K --prompt "the title, the car, the sky" --watch --json
|
|
3880
|
+
$ nodaro media split-layers https://x/poster.png --session <sessionId> --idempotency-key poster-1-layers
|
|
3881
|
+
|
|
3882
|
+
The finished job's output carries \`imageUrl\` (the base picture), \`layers\` (each
|
|
3883
|
+
layer's transparent PNG, bottom to top) and \`layerData\` (per layer: name,
|
|
3884
|
+
zIndex, the file's own width/height, \`box\` \u2014 where it sits on the base, in
|
|
3885
|
+
the base's pixels \u2014 and \`baseUrl\`, the base it was cut from). A layer is
|
|
3886
|
+
cropped to its element: scale it to its box to put it back in place. A run holds the price of --max-layers + 1 images and is
|
|
3887
|
+
charged only for the images it returns.`).action(async (imageUrl, opts) => {
|
|
3888
|
+
try {
|
|
3889
|
+
if (opts.maxLayers !== void 0 && !(Number.isInteger(opts.maxLayers) && opts.maxLayers >= SPLIT_LAYERS_MAX_LAYERS.min && opts.maxLayers <= SPLIT_LAYERS_MAX_LAYERS.max)) {
|
|
3890
|
+
warn(`--max-layers must be a whole number from ${SPLIT_LAYERS_MAX_LAYERS.min} to ${SPLIT_LAYERS_MAX_LAYERS.max}`);
|
|
3891
|
+
process.exit(1);
|
|
3892
|
+
}
|
|
3893
|
+
if (opts.size !== void 0 && !SPLIT_LAYERS_SIZES.includes(opts.size)) {
|
|
3894
|
+
warn(`--size must be one of ${SPLIT_LAYERS_SIZES.join(", ")} (got "${opts.size}")`);
|
|
3895
|
+
process.exit(1);
|
|
3896
|
+
}
|
|
3897
|
+
if (opts.prompt !== void 0 && opts.prompt.length > SPLIT_LAYERS_PROMPT_MAX) {
|
|
3898
|
+
warn(`--prompt must be at most ${SPLIT_LAYERS_PROMPT_MAX.toLocaleString("en-US")} characters`);
|
|
3899
|
+
process.exit(1);
|
|
3900
|
+
}
|
|
3901
|
+
const client = buildClient(opts.profile);
|
|
3902
|
+
const result = await client.media.splitIntoLayers({
|
|
3903
|
+
imageUrl,
|
|
3904
|
+
...opts.maxLayers !== void 0 ? { maxLayers: opts.maxLayers } : {},
|
|
3905
|
+
...opts.size !== void 0 ? { size: opts.size } : {},
|
|
3906
|
+
...opts.prompt ? { prompt: opts.prompt } : {},
|
|
3907
|
+
...opts.session !== void 0 ? { sessionId: opts.session } : {}
|
|
3908
|
+
}, opts.idempotencyKey ? { idempotencyKey: opts.idempotencyKey } : {});
|
|
3909
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "split into layers" });
|
|
3910
|
+
} catch (err) {
|
|
3911
|
+
handleError(err);
|
|
3912
|
+
}
|
|
3913
|
+
});
|
|
3840
3914
|
cmd.command("video-mask <videoUrl> <prompt>").description("track a subject described in text through a video (SAM 3.1, or --model sam-3 at half the price) and get a black-and-white mask video back (white = the subject)").option("--model <model>", `${VIDEO_MASK_PROVIDERS.join(" | ")} (default ${DEFAULT_VIDEO_MASK_PROVIDER})`).option("--threshold <n>", `detection confidence ${VIDEO_MASK_LIMITS.THRESHOLD_MIN}\u2013${VIDEO_MASK_LIMITS.THRESHOLD_MAX} (default ${VIDEO_MASK_LIMITS.THRESHOLD_DEFAULT}; lower finds more)`, parseFloat).option("--hold-last-mask", "keep the last mask on frames where the subject is lost (e.g. hidden behind a hand), for up to 1 s").option("--min-subject-height <pct>", `ignore subjects smaller than this % of the frame height, ${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--max-subject-height <pct>", `ignore subjects larger than this % of the frame height, ${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--zone <L,R,T,B>", `keep only subjects whose centre is inside these left,right,top,bottom margins, each ${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX} % of the frame (default off)`).option("--per-shot", "detect the subject again in every shot after a scene cut").option("--redetect-every <sec>", `also detect the subject again every <sec> seconds, ${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN}\u2013${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX} (default 0 = off) \u2014 catches someone who enters or turns to camera mid-shot; slower, same price`, (v) => Number(v)).option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
3841
3915
|
Examples:
|
|
3842
3916
|
$ nodaro media video-mask https://x/dance.mp4 "the dancer" --watch
|
|
@@ -4189,7 +4263,10 @@ Example:
|
|
|
4189
4263
|
cmd.command("transcribe").description("transcribe an audio (or video) track to text \u2014 elevenlabs-stt is always word-level and can diarize + tag audio events").requiredOption("--audio <url>", "audio (or video) URL to transcribe").option(
|
|
4190
4264
|
"--provider <name>",
|
|
4191
4265
|
`transcription engine: ${TRANSCRIBE_PROVIDERS.join(" | ")} \u2014 "${DEFAULT_TRANSCRIBE_PROVIDER}" returns NO word timings, named or reached by omitting this flag`
|
|
4192
|
-
).option("--language <code>", "language code to force (default: auto-detect)").option("--diarize", "label which speaker said each word (elevenlabs-stt)").option("--tag-audio-events", "tag laughter / applause / other non-speech events (elevenlabs-stt)").option("--word-timestamps", "ask for per-word timings \u2014 rejected up front on a lane that cannot produce them").option(
|
|
4266
|
+
).option("--language <code>", "language code to force (default: auto-detect)").option("--diarize", "label which speaker said each word (elevenlabs-stt)").option("--tag-audio-events", "tag laughter / applause / other non-speech events (elevenlabs-stt)").option("--word-timestamps", "ask for per-word timings \u2014 rejected up front on a lane that cannot produce them").option(
|
|
4267
|
+
"--target-language <code>",
|
|
4268
|
+
`translate the speech into this language instead (nemotron-3-5-transcribe only, to or from English; never with --word-timestamps): ${TRANSCRIBE_TARGET_LANGUAGES.join(" | ")}`
|
|
4269
|
+
).option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
4193
4270
|
The completed job's output_data carries: text (the whole transcript), words
|
|
4194
4271
|
(one entry per word, in MILLISECONDS) and json (the normalized transcript, also
|
|
4195
4272
|
ms). A top-level segments array (SECONDS) exists only on the legacy lanes \u2014
|
|
@@ -4202,7 +4279,10 @@ Feed the words straight into a kinetic caption render:
|
|
|
4202
4279
|
--style word-highlight --no-auto-transcribe --watch
|
|
4203
4280
|
|
|
4204
4281
|
Example:
|
|
4205
|
-
$ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch
|
|
4282
|
+
$ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch
|
|
4283
|
+
|
|
4284
|
+
Translate Spanish speech into English (Nemotron 3.5 Transcribe, priced per started minute):
|
|
4285
|
+
$ nodaro audio transcribe --audio https://.../entrevista.mp3 --provider nemotron-3-5-transcribe --target-language en --watch`).action(
|
|
4206
4286
|
async (opts) => {
|
|
4207
4287
|
try {
|
|
4208
4288
|
if (opts.provider && !TRANSCRIBE_PROVIDERS.includes(opts.provider)) {
|
|
@@ -4216,10 +4296,16 @@ Example:
|
|
|
4216
4296
|
);
|
|
4217
4297
|
process.exit(1);
|
|
4218
4298
|
}
|
|
4299
|
+
const translationRefusal = transcribeTranslationRefusal(resolvedLane, opts.targetLanguage, opts.wordTimestamps === true);
|
|
4300
|
+
if (translationRefusal) {
|
|
4301
|
+
warn(`--target-language: ${translationRefusal}`);
|
|
4302
|
+
process.exit(1);
|
|
4303
|
+
}
|
|
4219
4304
|
const client = buildClient(opts.profile);
|
|
4220
4305
|
const result = await client.audio.transcribe({
|
|
4221
4306
|
audioUrl: opts.audio,
|
|
4222
4307
|
...opts.provider ? { provider: opts.provider } : {},
|
|
4308
|
+
...opts.targetLanguage ? { targetLanguage: opts.targetLanguage } : {},
|
|
4223
4309
|
...opts.language ? { language: opts.language } : {},
|
|
4224
4310
|
...opts.diarize ? { diarize: true } : {},
|
|
4225
4311
|
...opts.tagAudioEvents ? { tagAudioEvents: true } : {},
|
|
@@ -5851,7 +5937,7 @@ Examples:
|
|
|
5851
5937
|
}
|
|
5852
5938
|
);
|
|
5853
5939
|
cmd.command("cost <ids...>").description(
|
|
5854
|
-
"credits each identifier is charged \u2014 a model id, a credit id, or a metered LLM price key (<feature>:<model>[:direct]); an estimate prints as \u2248N"
|
|
5940
|
+
"credits each identifier is charged \u2014 a model id, a credit id, or a metered LLM price key (<feature>:<model>[:direct | :effort-<level>]); an estimate prints as \u2248N"
|
|
5855
5941
|
).option("--profile <name>").option("--json").addHelpText(
|
|
5856
5942
|
"after",
|
|
5857
5943
|
`
|