@nodetool-ai/video-nodes 0.8.1
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 +58 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/ffmpeg-helpers.d.ts +77 -0
- package/dist/nodes/ffmpeg-helpers.d.ts.map +1 -0
- package/dist/nodes/ffmpeg-helpers.js +220 -0
- package/dist/nodes/ffmpeg-helpers.js.map +1 -0
- package/dist/nodes/lib-video-download.d.ts +29 -0
- package/dist/nodes/lib-video-download.d.ts.map +1 -0
- package/dist/nodes/lib-video-download.js +353 -0
- package/dist/nodes/lib-video-download.js.map +1 -0
- package/dist/nodes/model3d/analysis.d.ts +16 -0
- package/dist/nodes/model3d/analysis.d.ts.map +1 -0
- package/dist/nodes/model3d/analysis.js +38 -0
- package/dist/nodes/model3d/analysis.js.map +1 -0
- package/dist/nodes/model3d/base.d.ts +28 -0
- package/dist/nodes/model3d/base.d.ts.map +1 -0
- package/dist/nodes/model3d/base.js +20 -0
- package/dist/nodes/model3d/base.js.map +1 -0
- package/dist/nodes/model3d/boolean-ops.d.ts +2 -0
- package/dist/nodes/model3d/boolean-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/boolean-ops.js +172 -0
- package/dist/nodes/model3d/boolean-ops.js.map +1 -0
- package/dist/nodes/model3d/cleanup.d.ts +56 -0
- package/dist/nodes/model3d/cleanup.d.ts.map +1 -0
- package/dist/nodes/model3d/cleanup.js +144 -0
- package/dist/nodes/model3d/cleanup.js.map +1 -0
- package/dist/nodes/model3d/convert.d.ts +27 -0
- package/dist/nodes/model3d/convert.d.ts.map +1 -0
- package/dist/nodes/model3d/convert.js +66 -0
- package/dist/nodes/model3d/convert.js.map +1 -0
- package/dist/nodes/model3d/defaults.d.ts +34 -0
- package/dist/nodes/model3d/defaults.d.ts.map +1 -0
- package/dist/nodes/model3d/defaults.js +28 -0
- package/dist/nodes/model3d/defaults.js.map +1 -0
- package/dist/nodes/model3d/document-ops.d.ts +4 -0
- package/dist/nodes/model3d/document-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/document-ops.js +40 -0
- package/dist/nodes/model3d/document-ops.js.map +1 -0
- package/dist/nodes/model3d/generation.d.ts +56 -0
- package/dist/nodes/model3d/generation.d.ts.map +1 -0
- package/dist/nodes/model3d/generation.js +203 -0
- package/dist/nodes/model3d/generation.js.map +1 -0
- package/dist/nodes/model3d/glb.d.ts +29 -0
- package/dist/nodes/model3d/glb.d.ts.map +1 -0
- package/dist/nodes/model3d/glb.js +255 -0
- package/dist/nodes/model3d/glb.js.map +1 -0
- package/dist/nodes/model3d/index.d.ts +22 -0
- package/dist/nodes/model3d/index.d.ts.map +1 -0
- package/dist/nodes/model3d/index.js +41 -0
- package/dist/nodes/model3d/index.js.map +1 -0
- package/dist/nodes/model3d/io.d.ts +81 -0
- package/dist/nodes/model3d/io.d.ts.map +1 -0
- package/dist/nodes/model3d/io.js +162 -0
- package/dist/nodes/model3d/io.js.map +1 -0
- package/dist/nodes/model3d/mesh-ops.d.ts +40 -0
- package/dist/nodes/model3d/mesh-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/mesh-ops.js +775 -0
- package/dist/nodes/model3d/mesh-ops.js.map +1 -0
- package/dist/nodes/model3d/nodes.d.ts +2 -0
- package/dist/nodes/model3d/nodes.d.ts.map +1 -0
- package/dist/nodes/model3d/nodes.js +2 -0
- package/dist/nodes/model3d/nodes.js.map +1 -0
- package/dist/nodes/model3d/ops.d.ts +44 -0
- package/dist/nodes/model3d/ops.d.ts.map +1 -0
- package/dist/nodes/model3d/ops.js +142 -0
- package/dist/nodes/model3d/ops.js.map +1 -0
- package/dist/nodes/model3d/render.d.ts +51 -0
- package/dist/nodes/model3d/render.d.ts.map +1 -0
- package/dist/nodes/model3d/render.js +124 -0
- package/dist/nodes/model3d/render.js.map +1 -0
- package/dist/nodes/model3d/render3d-core.d.ts +177 -0
- package/dist/nodes/model3d/render3d-core.d.ts.map +1 -0
- package/dist/nodes/model3d/render3d-core.js +366 -0
- package/dist/nodes/model3d/render3d-core.js.map +1 -0
- package/dist/nodes/model3d/render3d-headless.d.ts +75 -0
- package/dist/nodes/model3d/render3d-headless.d.ts.map +1 -0
- package/dist/nodes/model3d/render3d-headless.js +190 -0
- package/dist/nodes/model3d/render3d-headless.js.map +1 -0
- package/dist/nodes/model3d/render3d-page.d.ts +16 -0
- package/dist/nodes/model3d/render3d-page.d.ts.map +1 -0
- package/dist/nodes/model3d/render3d-page.js +51 -0
- package/dist/nodes/model3d/render3d-page.js.map +1 -0
- package/dist/nodes/model3d/transforms.d.ts +56 -0
- package/dist/nodes/model3d/transforms.d.ts.map +1 -0
- package/dist/nodes/model3d/transforms.js +148 -0
- package/dist/nodes/model3d/transforms.js.map +1 -0
- package/dist/nodes/model3d/types.d.ts +82 -0
- package/dist/nodes/model3d/types.d.ts.map +1 -0
- package/dist/nodes/model3d/types.js +2 -0
- package/dist/nodes/model3d/types.js.map +1 -0
- package/dist/nodes/model3d/utils.d.ts +46 -0
- package/dist/nodes/model3d/utils.d.ts.map +1 -0
- package/dist/nodes/model3d/utils.js +190 -0
- package/dist/nodes/model3d/utils.js.map +1 -0
- package/dist/nodes/model3d.d.ts +2 -0
- package/dist/nodes/model3d.d.ts.map +1 -0
- package/dist/nodes/model3d.js +2 -0
- package/dist/nodes/model3d.js.map +1 -0
- package/dist/nodes/placeholder-values.d.ts +10 -0
- package/dist/nodes/placeholder-values.d.ts.map +1 -0
- package/dist/nodes/placeholder-values.js +19 -0
- package/dist/nodes/placeholder-values.js.map +1 -0
- package/dist/nodes/script.d.ts +161 -0
- package/dist/nodes/script.d.ts.map +1 -0
- package/dist/nodes/script.js +673 -0
- package/dist/nodes/script.js.map +1 -0
- package/dist/nodes/storyboard.d.ts +269 -0
- package/dist/nodes/storyboard.d.ts.map +1 -0
- package/dist/nodes/storyboard.js +1017 -0
- package/dist/nodes/storyboard.js.map +1 -0
- package/dist/nodes/timeline/assetFiles.d.ts +19 -0
- package/dist/nodes/timeline/assetFiles.d.ts.map +1 -0
- package/dist/nodes/timeline/assetFiles.js +52 -0
- package/dist/nodes/timeline/assetFiles.js.map +1 -0
- package/dist/nodes/timeline/compositeRender.d.ts +60 -0
- package/dist/nodes/timeline/compositeRender.d.ts.map +1 -0
- package/dist/nodes/timeline/compositeRender.js +508 -0
- package/dist/nodes/timeline/compositeRender.js.map +1 -0
- package/dist/nodes/timeline/contactSheet.d.ts +43 -0
- package/dist/nodes/timeline/contactSheet.d.ts.map +1 -0
- package/dist/nodes/timeline/contactSheet.js +78 -0
- package/dist/nodes/timeline/contactSheet.js.map +1 -0
- package/dist/nodes/timeline/outputFormats.d.ts +69 -0
- package/dist/nodes/timeline/outputFormats.d.ts.map +1 -0
- package/dist/nodes/timeline/outputFormats.js +173 -0
- package/dist/nodes/timeline/outputFormats.js.map +1 -0
- package/dist/nodes/timeline/pngSequence.d.ts +44 -0
- package/dist/nodes/timeline/pngSequence.d.ts.map +1 -0
- package/dist/nodes/timeline/pngSequence.js +172 -0
- package/dist/nodes/timeline/pngSequence.js.map +1 -0
- package/dist/nodes/timeline/rasterizers.d.ts +47 -0
- package/dist/nodes/timeline/rasterizers.d.ts.map +1 -0
- package/dist/nodes/timeline/rasterizers.js +103 -0
- package/dist/nodes/timeline/rasterizers.js.map +1 -0
- package/dist/nodes/timeline/rawFrames.d.ts +149 -0
- package/dist/nodes/timeline/rawFrames.d.ts.map +1 -0
- package/dist/nodes/timeline/rawFrames.js +598 -0
- package/dist/nodes/timeline/rawFrames.js.map +1 -0
- package/dist/nodes/timeline.d.ts +206 -0
- package/dist/nodes/timeline.d.ts.map +1 -0
- package/dist/nodes/timeline.js +1395 -0
- package/dist/nodes/timeline.js.map +1 -0
- package/dist/nodes/video.d.ts +705 -0
- package/dist/nodes/video.d.ts.map +1 -0
- package/dist/nodes/video.js +2672 -0
- package/dist/nodes/video.js.map +1 -0
- package/dist/render3d-page.js +4118 -0
- package/package.json +95 -0
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @nodetool-ai/video-nodes
|
|
2
|
+
|
|
3
|
+
Video and 3D-model nodes for [NodeTool](https://nodetool.ai).
|
|
4
|
+
|
|
5
|
+
A pack of video-processing and 3D-mesh nodes for NodeTool workflows: trim, concat,
|
|
6
|
+
and transform video; apply color and effects; run AI video generation and lip-sync;
|
|
7
|
+
edit timelines; and load, repair, and convert 3D models.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @nodetool-ai/video-nodes
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Nodes
|
|
16
|
+
|
|
17
|
+
### Video I/O
|
|
18
|
+
|
|
19
|
+
- `nodetool.video.LoadVideoFile`, `nodetool.video.LoadVideoAssets`
|
|
20
|
+
- `nodetool.video.SaveVideo`, `nodetool.video.SaveVideoFile`
|
|
21
|
+
- `nodetool.video.GetVideoInfo`
|
|
22
|
+
|
|
23
|
+
### Editing and transform
|
|
24
|
+
|
|
25
|
+
- `nodetool.video.Trim`, `nodetool.video.Concat`, `nodetool.video.Reverse`, `nodetool.video.SetSpeed`, `nodetool.video.Fps`
|
|
26
|
+
- `nodetool.video.Resize`, `nodetool.video.Rotate`, `nodetool.video.Overlay`, `nodetool.video.Transition`
|
|
27
|
+
- `nodetool.video.ExtractFrame`, `nodetool.video.FrameToVideo`, `nodetool.video.ForEachFrame`
|
|
28
|
+
- `nodetool.video.AddAudio`, `nodetool.video.ExtractAudio`, `nodetool.video.AddSubtitles`
|
|
29
|
+
|
|
30
|
+
### Color and effects
|
|
31
|
+
|
|
32
|
+
- `nodetool.video.Blur`, `nodetool.video.Sharpness`, `nodetool.video.Denoise`, `nodetool.video.Stabilize`
|
|
33
|
+
- `nodetool.video.ChromaKey`, `nodetool.video.ColorBalance`, `nodetool.video.Saturation`
|
|
34
|
+
|
|
35
|
+
### AI generation
|
|
36
|
+
|
|
37
|
+
- `nodetool.video.TextToVideo`, `nodetool.video.ImageToVideo`, `nodetool.video.VideoToVideo`
|
|
38
|
+
- `nodetool.video.LipSync`
|
|
39
|
+
|
|
40
|
+
### Timeline
|
|
41
|
+
|
|
42
|
+
Assemble clips and render a multi-track timeline.
|
|
43
|
+
|
|
44
|
+
- `nodetool.timeline.AddClips`, `nodetool.timeline.RenderTimeline`, `nodetool.timeline.Transcript`
|
|
45
|
+
|
|
46
|
+
### 3D models
|
|
47
|
+
|
|
48
|
+
Load, generate, transform, and repair meshes.
|
|
49
|
+
|
|
50
|
+
- I/O and metadata: `nodetool.model3d.LoadModel3DFile`, `nodetool.model3d.SaveModel3D`, `nodetool.model3d.SaveModel3DFile`, `nodetool.model3d.FormatConverter`, `nodetool.model3d.GetModel3DMetadata`
|
|
51
|
+
- Generation: `nodetool.model3d.TextTo3D`, `nodetool.model3d.ImageTo3D`
|
|
52
|
+
- Transform: `nodetool.model3d.Transform3D`, `nodetool.model3d.CenterMesh`, `nodetool.model3d.NormalizeModel3D`
|
|
53
|
+
- Mesh ops: `nodetool.model3d.Decimate`, `nodetool.model3d.RepairMesh`, `nodetool.model3d.MergeMeshes`, `nodetool.model3d.Boolean3D`, `nodetool.model3d.FlipNormals`, `nodetool.model3d.RecalculateNormals`, `nodetool.model3d.ExtractLargestComponent`
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- [NodeTool](https://nodetool.ai)
|
|
58
|
+
- [GitHub](https://github.com/nodetool-ai/nodetool)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-09-28T09:19:13.465Z
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./nodes/video.js";
|
|
2
|
+
export * from "./nodes/timeline.js";
|
|
3
|
+
export * from "./nodes/script.js";
|
|
4
|
+
export * from "./nodes/storyboard.js";
|
|
5
|
+
export * from "./nodes/lib-video-download.js";
|
|
6
|
+
export * from "./nodes/model3d.js";
|
|
7
|
+
export { TextTo3DNode, ImageTo3DNode } from "./nodes/model3d/generation.js";
|
|
8
|
+
export { DEFAULT_MODEL_3D, DEFAULT_FOLDER, DEFAULT_IMAGE, DEFAULT_TEXT_TO_3D_MODEL, DEFAULT_IMAGE_TO_3D_MODEL } from "./nodes/model3d/defaults.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AAInC,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./nodes/video.js";
|
|
2
|
+
export * from "./nodes/timeline.js";
|
|
3
|
+
export * from "./nodes/script.js";
|
|
4
|
+
export * from "./nodes/storyboard.js";
|
|
5
|
+
export * from "./nodes/lib-video-download.js";
|
|
6
|
+
export * from "./nodes/model3d.js";
|
|
7
|
+
// Submodule re-exports for callers (tests, codegen) that import the
|
|
8
|
+
// 3D-model defaults / generation node classes directly.
|
|
9
|
+
export { TextTo3DNode, ImageTo3DNode } from "./nodes/model3d/generation.js";
|
|
10
|
+
export { DEFAULT_MODEL_3D, DEFAULT_FOLDER, DEFAULT_IMAGE, DEFAULT_TEXT_TO_3D_MODEL, DEFAULT_IMAGE_TO_3D_MODEL } from "./nodes/model3d/defaults.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AAEnC,oEAAoE;AACpE,wDAAwD;AACxD,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ffmpeg/ffprobe helpers for the video nodes.
|
|
3
|
+
*
|
|
4
|
+
* Internal to the package — deliberately NOT re-exported from `src/index.ts`.
|
|
5
|
+
* Everything here is free of node-specific state so `timeline.ts` (and any other
|
|
6
|
+
* ffmpeg-backed module) can import it directly.
|
|
7
|
+
*
|
|
8
|
+
* Policy: a spawn failure because the binary is missing (`ENOENT`) surfaces as
|
|
9
|
+
* {@link MissingBinaryError} carrying the binary name. A genuine tool failure
|
|
10
|
+
* (non-zero exit) rejects with the underlying error, whose `.stderr` carries
|
|
11
|
+
* ffmpeg's diagnostics — callers turn that into an actionable message instead of
|
|
12
|
+
* silently passing the input through.
|
|
13
|
+
*/
|
|
14
|
+
import { execFile as execFileCb } from "node:child_process";
|
|
15
|
+
import type { VideoRef } from "@nodetool-ai/node-sdk";
|
|
16
|
+
export declare const execFile: typeof execFileCb.__promisify__;
|
|
17
|
+
export declare const FFMPEG_MAX_BUFFER: number;
|
|
18
|
+
/** A required binary (ffmpeg/ffprobe) is not installed or not on PATH. */
|
|
19
|
+
export declare class MissingBinaryError extends Error {
|
|
20
|
+
readonly binary: string;
|
|
21
|
+
constructor(binary: string);
|
|
22
|
+
}
|
|
23
|
+
/** Run ffmpeg, mapping a missing binary to {@link MissingBinaryError}. */
|
|
24
|
+
export declare function execFfmpeg(args: string[], options?: {
|
|
25
|
+
maxBuffer?: number;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
stdout: string;
|
|
28
|
+
stderr: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** Run ffprobe, mapping a missing binary to {@link MissingBinaryError}. */
|
|
31
|
+
export declare function execFfprobe(args: string[], options?: {
|
|
32
|
+
maxBuffer?: number;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
stdout: string;
|
|
35
|
+
stderr: string;
|
|
36
|
+
}>;
|
|
37
|
+
/** Build a VideoRef from raw bytes (raw base64 `data`, `type: "video"`). */
|
|
38
|
+
export declare function videoRef(data: Uint8Array, extras?: Partial<VideoRef>): VideoRef;
|
|
39
|
+
/** A fresh empty VideoRef prop default. Each call returns its own object. */
|
|
40
|
+
export declare function defaultVideoRef(): VideoRef;
|
|
41
|
+
/** Resolve a `file://` URI (or plain path) to a filesystem path. */
|
|
42
|
+
export declare function filePath(uriOrPath: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve a folder value to a filesystem path. Accepts a plain string path/URI
|
|
45
|
+
* or a folder ref object (`{ uri }`); returns "" when no usable path is present.
|
|
46
|
+
*/
|
|
47
|
+
export declare function folderPath(raw: unknown): string;
|
|
48
|
+
/** Expand %Y/%m/%d/%H/%M/%S date tokens in a filename. */
|
|
49
|
+
export declare function dateName(name: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Return a non-colliding path: `target` itself if free, otherwise `name-1.ext`,
|
|
52
|
+
* `name-2.ext`, … Guards saves in the same second (dateName granularity) from
|
|
53
|
+
* silently overwriting each other.
|
|
54
|
+
*/
|
|
55
|
+
export declare function uniqueTargetPath(target: string): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Parse an ffprobe `r_frame_rate` value ("30000/1001" or "25") into a number.
|
|
58
|
+
* Returns 0 for malformed values or zero denominators instead of NaN/Infinity.
|
|
59
|
+
*/
|
|
60
|
+
export declare function parseFrameRate(raw: string): number;
|
|
61
|
+
/**
|
|
62
|
+
* Probe a file's duration in seconds. A missing ffprobe binary surfaces as
|
|
63
|
+
* {@link MissingBinaryError}; a genuine probe failure (corrupt input) returns 0.
|
|
64
|
+
*/
|
|
65
|
+
export declare function ffprobeDuration(file: string): Promise<number>;
|
|
66
|
+
/** Write `bytes` to a temp file with `suffix`, returning its path + cleanup. */
|
|
67
|
+
export declare function withTempFile(suffix: string, bytes: Uint8Array): Promise<{
|
|
68
|
+
path: string;
|
|
69
|
+
cleanup: () => Promise<void>;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Normalize provider-prediction output to `Uint8Array`. Accepts `Uint8Array`,
|
|
73
|
+
* `Buffer`, or `ArrayBuffer`; anything else throws a clear error naming the node
|
|
74
|
+
* and the received type instead of casting blindly.
|
|
75
|
+
*/
|
|
76
|
+
export declare function coerceProviderBytes(value: unknown, nodeName: string): Uint8Array;
|
|
77
|
+
//# sourceMappingURL=ffmpeg-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ffmpeg-helpers.d.ts","sourceRoot":"","sources":["../../src/nodes/ffmpeg-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAM5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOtD,eAAO,MAAM,QAAQ,iCAAwB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,QAAmB,CAAC;AAElD,0EAA0E;AAC1E,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,YAAY,MAAM,EAAE,MAAM,EAQzB;CACF;AAWD,0EAA0E;AAC1E,wBAAsB,UAAU,CA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AE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAUzD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GACf,UAAU,CAeZ"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ffmpeg/ffprobe helpers for the video nodes.
|
|
3
|
+
*
|
|
4
|
+
* Internal to the package — deliberately NOT re-exported from `src/index.ts`.
|
|
5
|
+
* Everything here is free of node-specific state so `timeline.ts` (and any other
|
|
6
|
+
* ffmpeg-backed module) can import it directly.
|
|
7
|
+
*
|
|
8
|
+
* Policy: a spawn failure because the binary is missing (`ENOENT`) surfaces as
|
|
9
|
+
* {@link MissingBinaryError} carrying the binary name. A genuine tool failure
|
|
10
|
+
* (non-zero exit) rejects with the underlying error, whose `.stderr` carries
|
|
11
|
+
* ffmpeg's diagnostics — callers turn that into an actionable message instead of
|
|
12
|
+
* silently passing the input through.
|
|
13
|
+
*/
|
|
14
|
+
import { execFile as execFileCb } from "node:child_process";
|
|
15
|
+
import { promises as fs } from "node:fs";
|
|
16
|
+
import os from "node:os";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
import { promisify } from "node:util";
|
|
20
|
+
import { isNonEmptyString, isObjectLike, isString } from "@nodetool-ai/node-sdk";
|
|
21
|
+
export const execFile = promisify(execFileCb);
|
|
22
|
+
export const FFMPEG_MAX_BUFFER = 50 * 1024 * 1024;
|
|
23
|
+
/** A required binary (ffmpeg/ffprobe) is not installed or not on PATH. */
|
|
24
|
+
export class MissingBinaryError extends Error {
|
|
25
|
+
binary;
|
|
26
|
+
constructor(binary) {
|
|
27
|
+
super(`${binary} is not installed or not on PATH. Install ${binary} (the ` +
|
|
28
|
+
`Package Manager UI can do this) to process video — these nodes shell ` +
|
|
29
|
+
`out to ffmpeg/ffprobe and cannot run without it.`);
|
|
30
|
+
this.name = "MissingBinaryError";
|
|
31
|
+
this.binary = binary;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether `err` is a spawn ENOENT (binary not on PATH) rather than the tool
|
|
36
|
+
* running and reporting a non-zero exit. Scope this to the spawn itself so an
|
|
37
|
+
* unrelated filesystem ENOENT is never mislabeled as a missing binary.
|
|
38
|
+
*/
|
|
39
|
+
function isSpawnEnoent(err) {
|
|
40
|
+
return isObjectLike(err) && err.code === "ENOENT";
|
|
41
|
+
}
|
|
42
|
+
/** Run ffmpeg, mapping a missing binary to {@link MissingBinaryError}. */
|
|
43
|
+
export async function execFfmpeg(args, options = {}) {
|
|
44
|
+
try {
|
|
45
|
+
return await execFile("ffmpeg", args, options);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (isSpawnEnoent(error))
|
|
49
|
+
throw new MissingBinaryError("ffmpeg");
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Run ffprobe, mapping a missing binary to {@link MissingBinaryError}. */
|
|
54
|
+
export async function execFfprobe(args, options = {}) {
|
|
55
|
+
try {
|
|
56
|
+
return await execFile("ffprobe", args, options);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (isSpawnEnoent(error))
|
|
60
|
+
throw new MissingBinaryError("ffprobe");
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Build a VideoRef from raw bytes (raw base64 `data`, `type: "video"`). */
|
|
65
|
+
export function videoRef(data, extras = {}) {
|
|
66
|
+
return {
|
|
67
|
+
type: "video",
|
|
68
|
+
data: Buffer.from(data).toString("base64"),
|
|
69
|
+
...extras
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** A fresh empty VideoRef prop default. Each call returns its own object. */
|
|
73
|
+
export function defaultVideoRef() {
|
|
74
|
+
return {
|
|
75
|
+
type: "video",
|
|
76
|
+
uri: "",
|
|
77
|
+
asset_id: null,
|
|
78
|
+
data: null,
|
|
79
|
+
metadata: null,
|
|
80
|
+
duration: null,
|
|
81
|
+
format: null
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** Resolve a `file://` URI (or plain path) to a filesystem path. */
|
|
85
|
+
export function filePath(uriOrPath) {
|
|
86
|
+
if (uriOrPath.startsWith("file://")) {
|
|
87
|
+
try {
|
|
88
|
+
return fileURLToPath(new URL(uriOrPath));
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// Fallback for non-standard URIs like file://C:\path
|
|
92
|
+
return uriOrPath.slice("file://".length);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return uriOrPath;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolve a folder value to a filesystem path. Accepts a plain string path/URI
|
|
99
|
+
* or a folder ref object (`{ uri }`); returns "" when no usable path is present.
|
|
100
|
+
*/
|
|
101
|
+
export function folderPath(raw) {
|
|
102
|
+
if (isString(raw)) {
|
|
103
|
+
return raw.startsWith("file:") ? filePath(raw) : raw;
|
|
104
|
+
}
|
|
105
|
+
if (isObjectLike(raw)) {
|
|
106
|
+
const uri = raw.uri;
|
|
107
|
+
if (isNonEmptyString(uri))
|
|
108
|
+
return filePath(uri);
|
|
109
|
+
}
|
|
110
|
+
return "";
|
|
111
|
+
}
|
|
112
|
+
/** Expand %Y/%m/%d/%H/%M/%S date tokens in a filename. */
|
|
113
|
+
export function dateName(name) {
|
|
114
|
+
const now = new Date();
|
|
115
|
+
const pad = (v) => String(v).padStart(2, "0");
|
|
116
|
+
return name
|
|
117
|
+
.replaceAll("%Y", String(now.getFullYear()))
|
|
118
|
+
.replaceAll("%m", pad(now.getMonth() + 1))
|
|
119
|
+
.replaceAll("%d", pad(now.getDate()))
|
|
120
|
+
.replaceAll("%H", pad(now.getHours()))
|
|
121
|
+
.replaceAll("%M", pad(now.getMinutes()))
|
|
122
|
+
.replaceAll("%S", pad(now.getSeconds()));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Return a non-colliding path: `target` itself if free, otherwise `name-1.ext`,
|
|
126
|
+
* `name-2.ext`, … Guards saves in the same second (dateName granularity) from
|
|
127
|
+
* silently overwriting each other.
|
|
128
|
+
*/
|
|
129
|
+
export async function uniqueTargetPath(target) {
|
|
130
|
+
const exists = async (p) => {
|
|
131
|
+
try {
|
|
132
|
+
await fs.access(p);
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
if (!(await exists(target)))
|
|
140
|
+
return target;
|
|
141
|
+
const dir = path.dirname(target);
|
|
142
|
+
const ext = path.extname(target);
|
|
143
|
+
const base = path.basename(target, ext);
|
|
144
|
+
for (let i = 1;; i++) {
|
|
145
|
+
const candidate = path.join(dir, `${base}-${i}${ext}`);
|
|
146
|
+
if (!(await exists(candidate)))
|
|
147
|
+
return candidate;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Parse an ffprobe `r_frame_rate` value ("30000/1001" or "25") into a number.
|
|
152
|
+
* Returns 0 for malformed values or zero denominators instead of NaN/Infinity.
|
|
153
|
+
*/
|
|
154
|
+
export function parseFrameRate(raw) {
|
|
155
|
+
const parts = raw.trim().split("/");
|
|
156
|
+
if (parts.length === 2) {
|
|
157
|
+
const num = Number(parts[0]);
|
|
158
|
+
const den = Number(parts[1]);
|
|
159
|
+
return Number.isFinite(num) && den > 0 ? num / den : 0;
|
|
160
|
+
}
|
|
161
|
+
const val = Number(parts[0]);
|
|
162
|
+
return Number.isFinite(val) && val > 0 ? val : 0;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Probe a file's duration in seconds. A missing ffprobe binary surfaces as
|
|
166
|
+
* {@link MissingBinaryError}; a genuine probe failure (corrupt input) returns 0.
|
|
167
|
+
*/
|
|
168
|
+
export async function ffprobeDuration(file) {
|
|
169
|
+
try {
|
|
170
|
+
const { stdout } = await execFfprobe([
|
|
171
|
+
"-v",
|
|
172
|
+
"error",
|
|
173
|
+
"-show_entries",
|
|
174
|
+
"format=duration",
|
|
175
|
+
"-of",
|
|
176
|
+
"default=noprint_wrappers=1:nokey=1",
|
|
177
|
+
file
|
|
178
|
+
]);
|
|
179
|
+
const val = parseFloat(stdout.trim());
|
|
180
|
+
return isNaN(val) ? 0 : val;
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (error instanceof MissingBinaryError)
|
|
184
|
+
throw error;
|
|
185
|
+
return 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Write `bytes` to a temp file with `suffix`, returning its path + cleanup. */
|
|
189
|
+
export async function withTempFile(suffix, bytes) {
|
|
190
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "nodetool-video-"));
|
|
191
|
+
const file = path.join(dir, `input${suffix}`);
|
|
192
|
+
await fs.writeFile(file, bytes);
|
|
193
|
+
return {
|
|
194
|
+
path: file,
|
|
195
|
+
cleanup: async () => {
|
|
196
|
+
await fs.rm(dir, { recursive: true, force: true });
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Normalize provider-prediction output to `Uint8Array`. Accepts `Uint8Array`,
|
|
202
|
+
* `Buffer`, or `ArrayBuffer`; anything else throws a clear error naming the node
|
|
203
|
+
* and the received type instead of casting blindly.
|
|
204
|
+
*/
|
|
205
|
+
export function coerceProviderBytes(value, nodeName) {
|
|
206
|
+
if (value instanceof Uint8Array)
|
|
207
|
+
return value;
|
|
208
|
+
if (value instanceof ArrayBuffer)
|
|
209
|
+
return new Uint8Array(value);
|
|
210
|
+
const received = value === null
|
|
211
|
+
? "null"
|
|
212
|
+
: Array.isArray(value)
|
|
213
|
+
? "array"
|
|
214
|
+
: isObjectLike(value)
|
|
215
|
+
? (value.constructor?.name ?? "object")
|
|
216
|
+
: typeof value;
|
|
217
|
+
throw new Error(`${nodeName}: provider returned ${received}, expected video bytes ` +
|
|
218
|
+
`(Uint8Array/Buffer).`);
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=ffmpeg-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ffmpeg-helpers.js","sourceRoot":"","sources":["../../src/nodes/ffmpeg-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,0EAA0E;AAC1E,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,MAAM,CAAS;IACxB,YAAY,MAAc;QACxB,KAAK,CACH,GAAG,MAAM,6CAA6C,MAAM,QAAQ;YAClE,uEAAuE;YACvE,kDAAkD,CACrD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,YAAY,CAAC,GAAG,CAAC,IAAK,GAA0B,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC5E,CAAC;AAED,0EAA0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ode {
|
|
3
|
+
static readonly nodeType = "lib.video.download.YtDlpDownload";
|
|
4
|
+
static readonly title = "YouTube Downloader";
|
|
5
|
+
static readonly description = "Download media from URLs using yt-dlp.\n download, video, audio, youtube, media, yt-dlp, metadata, subtitles\n\n Use cases:\n - Download videos from YouTube and other platforms\n - Extract audio from video URLs\n - Retrieve video/audio metadata without downloading\n - Download subtitles and thumbnails";
|
|
6
|
+
static readonly metadataOutputTypes: {
|
|
7
|
+
video: string;
|
|
8
|
+
audio: string;
|
|
9
|
+
metadata: string;
|
|
10
|
+
subtitles: string;
|
|
11
|
+
thumbnail: string;
|
|
12
|
+
};
|
|
13
|
+
static readonly inlineFields: string[];
|
|
14
|
+
static readonly inputFields: string[];
|
|
15
|
+
static readonly requiredRuntimes: string[];
|
|
16
|
+
url: string;
|
|
17
|
+
mode: string;
|
|
18
|
+
format_selector: string;
|
|
19
|
+
container: string;
|
|
20
|
+
subtitles: boolean;
|
|
21
|
+
sub_langs: string;
|
|
22
|
+
thumbnail: boolean;
|
|
23
|
+
overwrite: boolean;
|
|
24
|
+
rate_limit_kbps: number;
|
|
25
|
+
timeout: number;
|
|
26
|
+
process(): Promise<Record<string, unknown>>;
|
|
27
|
+
}
|
|
28
|
+
export declare const LIB_YTDLP_NODES: readonly [typeof YtDlpDownloadLibNode];
|
|
29
|
+
//# sourceMappingURL=lib-video-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib-video-download.d.ts","sourceRoot":"","sources":["../../src/nodes/lib-video-download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,uBAAuB,CAAC;AAmJvD,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,sCAAsC;IAC9D,MAAM,CAAC,QAAQ,CAAC,KAAK,wBAAwB;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,sUAC0S;IACrU,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QACjC,KAAK;QACL,KAAK;QACL,QAAQ;QACR,SAAS;QACT,SAAS;MACT;IACF,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAW;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAW;IAChD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,WAAc;IAQtC,GAAG,EAAE,MAAM,CAAC;IASZ,IAAI,EAAE,MAAM,CAAC;IAQb,eAAe,EAAE,MAAM,CAAC;IAQxB,SAAS,EAAE,MAAM,CAAC;IAQlB,SAAS,EAAE,OAAO,CAAC;IASnB,SAAS,EAAE,MAAM,CAAC;IAQlB,SAAS,EAAE,OAAO,CAAC;IAQnB,SAAS,EAAE,OAAO,CAAC;IASnB,eAAe,EAAE,MAAM,CAAC;IAUxB,OAAO,EAAE,MAAM,CAAC;IAElB,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0KhD;CACF;AAED,eAAO,MAAM,eAAe,wCAAkC,CAAC"}
|