@remotion/video-matting 4.0.526 → 4.0.528
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/dist/create-video-layer-output.d.ts +1 -0
- package/dist/create-video-matting-frames.d.ts +29 -0
- package/dist/download-video-matting-model.d.ts +16 -0
- package/dist/esm/index.mjs +875 -220
- package/dist/import-node-module.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/load-video-matting-model.d.ts +9 -7
- package/dist/node-video-matting-frames.d.ts +2 -0
- package/dist/output-target.d.ts +1 -1
- package/dist/prepare-audio.d.ts +1 -1
- package/dist/probe-node-webgpu.d.ts +3 -0
- package/dist/separate-video-layers.d.ts +14 -1
- package/dist/symbol-async-dispose.d.ts +0 -0
- package/dist/with-remotion-model-host.d.ts +2 -1
- package/package.json +6 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const importNodeModule: <T>(specifier: string) => Promise<T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { canUseVideoMatting, VideoMattingUnsupportedReason, } from './can-use-video-matting';
|
|
2
2
|
export type { CanUseVideoMattingOptions, CanUseVideoMattingResult, } from './can-use-video-matting';
|
|
3
3
|
export { disposeVideoMattingModel, loadVideoMattingModel, } from './load-video-matting-model';
|
|
4
|
+
export { downloadVideoMattingModel } from './download-video-matting-model';
|
|
5
|
+
export type { DownloadVideoMattingModelOptions, DownloadVideoMattingModelResult, VideoMattingModelDownloadProgress, } from './download-video-matting-model';
|
|
4
6
|
export type { DisposeVideoMattingModelOptions, LoadVideoMattingModelOptions, LoadVideoMattingModelResult, OnVideoMattingModelLoadProgress, VideoMattingModelLoadProgress, } from './load-video-matting-model';
|
|
5
7
|
export { isVideoMattingModelCached } from './is-video-matting-model-cached';
|
|
6
8
|
export type { IsVideoMattingModelCachedOptions } from './is-video-matting-model-cached';
|
|
@@ -9,6 +11,9 @@ export type { RemoveVideoMattingModelOptions } from './remove-video-matting-mode
|
|
|
9
11
|
export { getAvailableModels } from './models';
|
|
10
12
|
export type { VideoMattingModel, VideoMattingModelInfo } from './models';
|
|
11
13
|
export type { VideoLayerOutput, VideoLayerOutputOptions, VideoLayerOutputTarget, } from './output-target';
|
|
14
|
+
export declare const VideoMattingInternals: {
|
|
15
|
+
removeVideoBackground: (options: import("./separate-video-layers").RemoveVideoBackgroundOptions) => Promise<import("./separate-video-layers").RemoveVideoBackgroundResult>;
|
|
16
|
+
};
|
|
12
17
|
export { separateVideoLayers } from './separate-video-layers';
|
|
13
18
|
export type { SeparateVideoLayersOptions, SeparateVideoLayersProgress, SeparateVideoLayersResult, VideoLayerAudio, } from './separate-video-layers';
|
|
14
19
|
export type { VideoMattingBitrate, VideoMattingQuality, } from './video-matting-quality';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './symbol-async-dispose';
|
|
1
2
|
import { type VideoMattingModel } from './models';
|
|
2
3
|
export type VideoMattingModelLoadProgress = {
|
|
3
4
|
status: string;
|
|
@@ -7,7 +8,7 @@ export type VideoMattingModelLoadProgress = {
|
|
|
7
8
|
totalBytes: number | null;
|
|
8
9
|
};
|
|
9
10
|
export type OnVideoMattingModelLoadProgress = (progress: VideoMattingModelLoadProgress) => void;
|
|
10
|
-
export type VideoMattingImageSource = HTMLCanvasElement | OffscreenCanvas;
|
|
11
|
+
export type VideoMattingImageSource = HTMLCanvasElement | OffscreenCanvas | VideoMattingPipelineResult;
|
|
11
12
|
export type VideoMattingPipelineResult = {
|
|
12
13
|
data: Uint8ClampedArray<ArrayBuffer>;
|
|
13
14
|
width: number;
|
|
@@ -17,19 +18,20 @@ export type VideoMattingPipelineResult = {
|
|
|
17
18
|
export type LoadedVideoMattingPipeline = (image: VideoMattingImageSource) => Promise<VideoMattingPipelineResult>;
|
|
18
19
|
export type LoadVideoMattingModelOptions = {
|
|
19
20
|
model: VideoMattingModel;
|
|
21
|
+
signal?: AbortSignal;
|
|
20
22
|
onProgress?: OnVideoMattingModelLoadProgress;
|
|
21
23
|
};
|
|
22
|
-
export type LoadVideoMattingModelResult = {
|
|
24
|
+
export type LoadVideoMattingModelResult = AsyncDisposable & {
|
|
23
25
|
alreadyLoaded: boolean;
|
|
24
26
|
};
|
|
25
|
-
export
|
|
27
|
+
export type DisposeVideoMattingModelOptions = {
|
|
28
|
+
model?: VideoMattingModel;
|
|
29
|
+
};
|
|
30
|
+
export declare const disposeVideoMattingModel: ({ model, }?: DisposeVideoMattingModelOptions) => Promise<void>;
|
|
31
|
+
export declare const loadVideoMattingModel: ({ model, signal, onProgress, }: LoadVideoMattingModelOptions) => Promise<LoadVideoMattingModelResult>;
|
|
26
32
|
export declare const withLoadedVideoMattingPipeline: <ReturnValue>({ model, onProgress, signal, run, }: {
|
|
27
33
|
model: "ben2-base" | "modnet";
|
|
28
34
|
onProgress?: OnVideoMattingModelLoadProgress | undefined;
|
|
29
35
|
signal: AbortSignal | null;
|
|
30
36
|
run: (pipeline: LoadedVideoMattingPipeline) => Promise<ReturnValue>;
|
|
31
37
|
}) => Promise<ReturnValue>;
|
|
32
|
-
export type DisposeVideoMattingModelOptions = {
|
|
33
|
-
model?: VideoMattingModel;
|
|
34
|
-
};
|
|
35
|
-
export declare const disposeVideoMattingModel: ({ model, }?: DisposeVideoMattingModelOptions) => Promise<void>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { VideoMattingFrames, VideoMattingFramesOptions } from './create-video-matting-frames';
|
|
2
|
+
export declare const createNodeVideoMattingFrames: ({ videoTrack, width, height, videoQuality, keyframeIntervalInSeconds, videoStartTimestamp, videoEndTimestamp, includeBase, }: VideoMattingFramesOptions) => VideoMattingFrames;
|
package/dist/output-target.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type VideoLayerOutputOptions = {
|
|
|
7
7
|
outputTarget?: never;
|
|
8
8
|
outputWritable: WritableStream<StreamTargetChunk>;
|
|
9
9
|
};
|
|
10
|
-
export type VideoLayerOutput = {
|
|
10
|
+
export type VideoLayerOutput = AsyncDisposable & {
|
|
11
11
|
getBlob: () => Promise<Blob>;
|
|
12
12
|
dispose: () => Promise<void>;
|
|
13
13
|
};
|
package/dist/prepare-audio.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type PreparedVideoMattingAudio = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const prepareAudio: <BaseTarget extends Target, ForegroundTarget extends Target>({ input, baseOutput, foregroundOutput, destination, videoStartTimestamp, videoEndTimestamp, audioQuality, forceTranscode, }: {
|
|
20
20
|
input: Input<import("mediabunny").Source>;
|
|
21
|
-
baseOutput: Output<WebMOutputFormat, BaseTarget
|
|
21
|
+
baseOutput: Output<WebMOutputFormat, BaseTarget> | null;
|
|
22
22
|
foregroundOutput: Output<WebMOutputFormat, ForegroundTarget>;
|
|
23
23
|
destination: VideoMattingAudioDestination;
|
|
24
24
|
videoStartTimestamp: number;
|
|
@@ -30,7 +30,7 @@ export type SeparateVideoLayersOptions = {
|
|
|
30
30
|
onModelLoadProgress?: OnVideoMattingModelLoadProgress;
|
|
31
31
|
onProgress?: (progress: SeparateVideoLayersProgress) => void;
|
|
32
32
|
};
|
|
33
|
-
export type SeparateVideoLayersResult = {
|
|
33
|
+
export type SeparateVideoLayersResult = AsyncDisposable & {
|
|
34
34
|
base: VideoLayerOutput;
|
|
35
35
|
foreground: VideoLayerOutput;
|
|
36
36
|
model: VideoMattingModel;
|
|
@@ -39,5 +39,18 @@ export type SeparateVideoLayersResult = {
|
|
|
39
39
|
durationInSeconds: number;
|
|
40
40
|
processedFrames: number;
|
|
41
41
|
};
|
|
42
|
+
export type RemoveVideoBackgroundOptions = Omit<SeparateVideoLayersOptions, 'audio' | 'outputs'> & {
|
|
43
|
+
audio?: 'keep' | 'none';
|
|
44
|
+
output?: VideoLayerOutputOptions;
|
|
45
|
+
};
|
|
46
|
+
export type RemoveVideoBackgroundResult = AsyncDisposable & {
|
|
47
|
+
video: VideoLayerOutput;
|
|
48
|
+
model: VideoMattingModel;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
durationInSeconds: number;
|
|
52
|
+
processedFrames: number;
|
|
53
|
+
};
|
|
42
54
|
export declare const separateVideoLayers: (options: SeparateVideoLayersOptions) => Promise<SeparateVideoLayersResult>;
|
|
55
|
+
export declare const removeVideoBackground: (options: RemoveVideoBackgroundOptions) => Promise<RemoveVideoBackgroundResult>;
|
|
43
56
|
export {};
|
|
File without changes
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { AutoModelForImageSegmentation, AutoProcessor, BackgroundRemovalPipeline, env, ModelRegistry } from '@huggingface/transformers';
|
|
1
|
+
import type { AutoModelForImageSegmentation, AutoProcessor, BackgroundRemovalPipeline, env, ModelRegistry, RawImage } from '@huggingface/transformers';
|
|
2
2
|
type TransformersModule = {
|
|
3
3
|
readonly AutoModelForImageSegmentation: typeof AutoModelForImageSegmentation;
|
|
4
4
|
readonly AutoProcessor: typeof AutoProcessor;
|
|
5
5
|
readonly BackgroundRemovalPipeline: typeof BackgroundRemovalPipeline;
|
|
6
6
|
readonly env: typeof env;
|
|
7
7
|
readonly ModelRegistry: typeof ModelRegistry;
|
|
8
|
+
readonly RawImage: typeof RawImage;
|
|
8
9
|
};
|
|
9
10
|
export declare const withRemotionModelHost: <ReturnValue>(operation: (transformers: TransformersModule) => Promise<ReturnValue>) => Promise<ReturnValue>;
|
|
10
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/video-matting",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.528",
|
|
4
4
|
"description": "Separate a video into a base layer and transparent foreground in the browser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"mediabunny": "1.56.1"
|
|
27
|
+
"mediabunny": "1.56.1",
|
|
28
|
+
"onnxruntime-node": "1.24.3"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"@huggingface/transformers": "4.
|
|
31
|
+
"@huggingface/transformers": "4.2.0"
|
|
31
32
|
},
|
|
32
33
|
"exports": {
|
|
33
34
|
".": {
|
|
@@ -38,8 +39,8 @@
|
|
|
38
39
|
"./package.json": "./package.json"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@huggingface/transformers": "4.
|
|
42
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
42
|
+
"@huggingface/transformers": "4.2.0",
|
|
43
|
+
"@remotion/eslint-config-internal": "4.0.528",
|
|
43
44
|
"@typescript/native-preview": "7.0.0-dev.20260217.1",
|
|
44
45
|
"eslint": "9.19.0"
|
|
45
46
|
},
|