simple-ffmpegjs 0.3.4 → 0.3.6
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 +113 -48
- package/package.json +1 -1
- package/src/core/gaps.js +27 -1
- package/src/core/validation.js +250 -2
- package/src/ffmpeg/audio_builder.js +12 -3
- package/src/ffmpeg/video_builder.js +219 -57
- package/src/ffmpeg/watermark_builder.js +13 -0
- package/src/loaders.js +9 -2
- package/src/schema/modules/image.js +24 -6
- package/src/simpleffmpeg.js +102 -8
- package/types/index.d.mts +32 -11
- package/types/index.d.ts +32 -11
package/types/index.d.mts
CHANGED
|
@@ -88,16 +88,37 @@ declare namespace SIMPLEFFMPEG {
|
|
|
88
88
|
loop?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
type KenBurnsEffect =
|
|
92
|
+
| "zoom-in"
|
|
93
|
+
| "zoom-out"
|
|
94
|
+
| "pan-left"
|
|
95
|
+
| "pan-right"
|
|
96
|
+
| "pan-up"
|
|
97
|
+
| "pan-down"
|
|
98
|
+
| "smart"
|
|
99
|
+
| "custom";
|
|
100
|
+
|
|
101
|
+
type KenBurnsAnchor = "top" | "bottom" | "left" | "right";
|
|
102
|
+
type KenBurnsEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out";
|
|
103
|
+
|
|
104
|
+
interface KenBurnsSpec {
|
|
105
|
+
type?: KenBurnsEffect;
|
|
106
|
+
startZoom?: number;
|
|
107
|
+
endZoom?: number;
|
|
108
|
+
startX?: number;
|
|
109
|
+
startY?: number;
|
|
110
|
+
endX?: number;
|
|
111
|
+
endY?: number;
|
|
112
|
+
anchor?: KenBurnsAnchor;
|
|
113
|
+
easing?: KenBurnsEasing;
|
|
114
|
+
}
|
|
115
|
+
|
|
91
116
|
interface ImageClip extends BaseClip {
|
|
92
117
|
type: "image";
|
|
93
118
|
url: string;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| "pan-left"
|
|
98
|
-
| "pan-right"
|
|
99
|
-
| "pan-up"
|
|
100
|
-
| "pan-down";
|
|
119
|
+
width?: number;
|
|
120
|
+
height?: number;
|
|
121
|
+
kenBurns?: KenBurnsEffect | KenBurnsSpec;
|
|
101
122
|
}
|
|
102
123
|
|
|
103
124
|
type TextMode = "static" | "word-replace" | "word-sequential" | "karaoke";
|
|
@@ -276,8 +297,8 @@ declare namespace SIMPLEFFMPEG {
|
|
|
276
297
|
interface ValidateOptions {
|
|
277
298
|
/** Skip file existence checks (useful for AI generating configs before files exist) */
|
|
278
299
|
skipFileChecks?: boolean;
|
|
279
|
-
/** Gap handling mode - affects timeline gap validation */
|
|
280
|
-
fillGaps?: "none" |
|
|
300
|
+
/** Gap handling mode - affects timeline gap validation. Any valid FFmpeg color, or "none"/false to disable. */
|
|
301
|
+
fillGaps?: "none" | string | boolean;
|
|
281
302
|
/** Project width - used to validate Ken Burns images are large enough */
|
|
282
303
|
width?: number;
|
|
283
304
|
/** Project height - used to validate Ken Burns images are large enough */
|
|
@@ -297,8 +318,8 @@ declare namespace SIMPLEFFMPEG {
|
|
|
297
318
|
height?: number;
|
|
298
319
|
/** Validation mode: 'warn' logs warnings, 'strict' throws on warnings (default: 'warn') */
|
|
299
320
|
validationMode?: "warn" | "strict";
|
|
300
|
-
/** How to handle visual gaps: 'none'
|
|
301
|
-
fillGaps?: "none" |
|
|
321
|
+
/** How to handle visual gaps: 'none'/false (disabled), true/'black' (black fill), or any valid FFmpeg color name/hex (default: 'none') */
|
|
322
|
+
fillGaps?: "none" | string | boolean;
|
|
302
323
|
}
|
|
303
324
|
|
|
304
325
|
/** Log entry passed to onLog callback */
|
package/types/index.d.ts
CHANGED
|
@@ -88,16 +88,37 @@ declare namespace SIMPLEFFMPEG {
|
|
|
88
88
|
loop?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
type KenBurnsEffect =
|
|
92
|
+
| "zoom-in"
|
|
93
|
+
| "zoom-out"
|
|
94
|
+
| "pan-left"
|
|
95
|
+
| "pan-right"
|
|
96
|
+
| "pan-up"
|
|
97
|
+
| "pan-down"
|
|
98
|
+
| "smart"
|
|
99
|
+
| "custom";
|
|
100
|
+
|
|
101
|
+
type KenBurnsAnchor = "top" | "bottom" | "left" | "right";
|
|
102
|
+
type KenBurnsEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out";
|
|
103
|
+
|
|
104
|
+
interface KenBurnsSpec {
|
|
105
|
+
type?: KenBurnsEffect;
|
|
106
|
+
startZoom?: number;
|
|
107
|
+
endZoom?: number;
|
|
108
|
+
startX?: number;
|
|
109
|
+
startY?: number;
|
|
110
|
+
endX?: number;
|
|
111
|
+
endY?: number;
|
|
112
|
+
anchor?: KenBurnsAnchor;
|
|
113
|
+
easing?: KenBurnsEasing;
|
|
114
|
+
}
|
|
115
|
+
|
|
91
116
|
interface ImageClip extends BaseClip {
|
|
92
117
|
type: "image";
|
|
93
118
|
url: string;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| "pan-left"
|
|
98
|
-
| "pan-right"
|
|
99
|
-
| "pan-up"
|
|
100
|
-
| "pan-down";
|
|
119
|
+
width?: number;
|
|
120
|
+
height?: number;
|
|
121
|
+
kenBurns?: KenBurnsEffect | KenBurnsSpec;
|
|
101
122
|
}
|
|
102
123
|
|
|
103
124
|
type TextMode = "static" | "word-replace" | "word-sequential" | "karaoke";
|
|
@@ -276,8 +297,8 @@ declare namespace SIMPLEFFMPEG {
|
|
|
276
297
|
interface ValidateOptions {
|
|
277
298
|
/** Skip file existence checks (useful for AI generating configs before files exist) */
|
|
278
299
|
skipFileChecks?: boolean;
|
|
279
|
-
/** Gap handling mode - affects timeline gap validation */
|
|
280
|
-
fillGaps?: "none" |
|
|
300
|
+
/** Gap handling mode - affects timeline gap validation. Any valid FFmpeg color, or "none"/false to disable. */
|
|
301
|
+
fillGaps?: "none" | string | boolean;
|
|
281
302
|
/** Project width - used to validate Ken Burns images are large enough */
|
|
282
303
|
width?: number;
|
|
283
304
|
/** Project height - used to validate Ken Burns images are large enough */
|
|
@@ -297,8 +318,8 @@ declare namespace SIMPLEFFMPEG {
|
|
|
297
318
|
height?: number;
|
|
298
319
|
/** Validation mode: 'warn' logs warnings, 'strict' throws on warnings (default: 'warn') */
|
|
299
320
|
validationMode?: "warn" | "strict";
|
|
300
|
-
/** How to handle visual gaps: 'none'
|
|
301
|
-
fillGaps?: "none" |
|
|
321
|
+
/** How to handle visual gaps: 'none'/false (disabled), true/'black' (black fill), or any valid FFmpeg color name/hex (default: 'none') */
|
|
322
|
+
fillGaps?: "none" | string | boolean;
|
|
302
323
|
}
|
|
303
324
|
|
|
304
325
|
/** Log entry passed to onLog callback */
|