@designcombo/video 0.0.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/LICENSE +63 -0
- package/dist/SharedSystems-BSw9neqH.js +2691 -0
- package/dist/WebGLRenderer-BrabW-VK.js +2639 -0
- package/dist/WebGPURenderer-BKwBKkzk.js +1655 -0
- package/dist/browserAll-C7HVZtqZ.js +1876 -0
- package/dist/clips/audio-clip.d.ts +132 -0
- package/dist/clips/base-clip.d.ts +86 -0
- package/dist/clips/caption-clip.d.ts +257 -0
- package/dist/clips/iclip.d.ts +120 -0
- package/dist/clips/image-clip.d.ts +110 -0
- package/dist/clips/index.d.ts +8 -0
- package/dist/clips/text-clip.d.ts +192 -0
- package/dist/clips/video-clip.d.ts +200 -0
- package/dist/colorToUniform-Du0ROyNd.js +274 -0
- package/dist/compositor.d.ts +111 -0
- package/dist/index-CjzowIhV.js +28270 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.es.js +20 -0
- package/dist/index.umd.js +1295 -0
- package/dist/internal-utils/event-tool.d.ts +50 -0
- package/dist/internal-utils/index.d.ts +14 -0
- package/dist/internal-utils/log.d.ts +34 -0
- package/dist/internal-utils/meta-box.d.ts +1 -0
- package/dist/internal-utils/recodemux.d.ts +65 -0
- package/dist/internal-utils/stream-utils.d.ts +43 -0
- package/dist/internal-utils/worker-timer.d.ts +8 -0
- package/dist/json-serialization.d.ts +142 -0
- package/dist/mp4-utils/index.d.ts +31 -0
- package/dist/mp4-utils/mp4box-utils.d.ts +36 -0
- package/dist/mp4-utils/sample-transform.d.ts +23 -0
- package/dist/sprite/base-sprite.d.ts +147 -0
- package/dist/sprite/pixi-sprite-renderer.d.ts +48 -0
- package/dist/studio.d.ts +142 -0
- package/dist/transfomer/parts/handle.d.ts +17 -0
- package/dist/transfomer/parts/wireframe.d.ts +5 -0
- package/dist/transfomer/transformer.d.ts +21 -0
- package/dist/utils/audio.d.ts +82 -0
- package/dist/utils/chromakey.d.ts +24 -0
- package/dist/utils/color.d.ts +4 -0
- package/dist/utils/common.d.ts +7 -0
- package/dist/utils/dom.d.ts +48 -0
- package/dist/utils/fonts.d.ts +16 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/srt-parser.d.ts +15 -0
- package/dist/utils/video.d.ts +18 -0
- package/dist/webworkerAll-DsE6HIYE.js +2497 -0
- package/package.json +53 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { IClip } from './clips';
|
|
2
|
+
import { ProjectJSON } from './json-serialization';
|
|
3
|
+
export interface ICompositorOpts {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
bitrate?: number;
|
|
7
|
+
fps?: number;
|
|
8
|
+
bgColor?: string;
|
|
9
|
+
videoCodec?: string;
|
|
10
|
+
/**
|
|
11
|
+
* If false, exclude audio track from the output video
|
|
12
|
+
*/
|
|
13
|
+
audio?: false;
|
|
14
|
+
/**
|
|
15
|
+
* Write metadata tags to the output video
|
|
16
|
+
*/
|
|
17
|
+
metaDataTags?: Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Unsafe, may be deprecated at any time
|
|
20
|
+
*/
|
|
21
|
+
__unsafe_hardwareAcceleration__?: HardwarePreference;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Video compositor that can add multiple {@link OffscreenSprite} instances,
|
|
25
|
+
* compositing them based on position, z-index, time offset, etc., into an output video file
|
|
26
|
+
* @see [Video Composition](https://webav-tech.github.io/WebAV/demo/2_1-concat-video)
|
|
27
|
+
* @see [Video Audio Mixing](https://webav-tech.github.io/WebAV/demo/2_2-video-add-audio)
|
|
28
|
+
* @example
|
|
29
|
+
* const spr1 = new OffscreenSprite(
|
|
30
|
+
* new VideoClip((await fetch('<mp4 url>')).body),
|
|
31
|
+
* );
|
|
32
|
+
* const spr2 = new OffscreenSprite(
|
|
33
|
+
* await AudioClip.fromUrl('<audio url>'),
|
|
34
|
+
* );
|
|
35
|
+
* const com = new Compositor({ width: 1280, height: 720, });
|
|
36
|
+
|
|
37
|
+
* await com.addSprite(spr1);
|
|
38
|
+
* await com.addSprite(spr2);
|
|
39
|
+
|
|
40
|
+
* com.output(); // => ReadableStream
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
export declare class Compositor {
|
|
44
|
+
/**
|
|
45
|
+
* Check compatibility with the current environment
|
|
46
|
+
* @param args.videoCodec Specify video codec, default avc1.42E032
|
|
47
|
+
* @param args.width Specify video width, default 1920
|
|
48
|
+
* @param args.height Specify video height, default 1080
|
|
49
|
+
* @param args.bitrate Specify video bitrate, default 5e6
|
|
50
|
+
*/
|
|
51
|
+
static isSupported(args?: {
|
|
52
|
+
videoCodec?: string;
|
|
53
|
+
width?: number;
|
|
54
|
+
height?: number;
|
|
55
|
+
bitrate?: number;
|
|
56
|
+
}): Promise<boolean>;
|
|
57
|
+
private logger;
|
|
58
|
+
private destroyed;
|
|
59
|
+
private sprites;
|
|
60
|
+
private canvas;
|
|
61
|
+
private pixiApp;
|
|
62
|
+
private stopOutput;
|
|
63
|
+
private opts;
|
|
64
|
+
private hasVideoTrack;
|
|
65
|
+
private evtTool;
|
|
66
|
+
on: <Type extends "error" | "OutputProgress">(type: Type, listener: {
|
|
67
|
+
OutputProgress: (progress: number) => void;
|
|
68
|
+
error: (err: Error) => void;
|
|
69
|
+
}[Type]) => (() => void);
|
|
70
|
+
/**
|
|
71
|
+
* Create a compositor instance based on configuration
|
|
72
|
+
* @param opts ICompositorOpts
|
|
73
|
+
*/
|
|
74
|
+
constructor(opts?: ICompositorOpts);
|
|
75
|
+
initPixiApp(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Add a clip for video composition. Video duration defaults to the maximum duration value from all clips
|
|
78
|
+
* @param clip Clip (extends BaseSprite)
|
|
79
|
+
* @param opts.main If main is true, the video duration uses this clip's duration value
|
|
80
|
+
*/
|
|
81
|
+
addSprite(clip: IClip, opts?: {
|
|
82
|
+
main?: boolean;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
private initMuxer;
|
|
85
|
+
/**
|
|
86
|
+
* Output video file binary stream
|
|
87
|
+
* @param opts.maxTime Maximum duration allowed for output video, content exceeding this will be ignored
|
|
88
|
+
*/
|
|
89
|
+
output(opts?: {
|
|
90
|
+
maxTime?: number;
|
|
91
|
+
}): ReadableStream<Uint8Array>;
|
|
92
|
+
/**
|
|
93
|
+
* Destroy instance and release resources
|
|
94
|
+
*/
|
|
95
|
+
destroy(): void;
|
|
96
|
+
private runEncoding;
|
|
97
|
+
/**
|
|
98
|
+
* Export current compositor state to JSON
|
|
99
|
+
*/
|
|
100
|
+
exportToJSON(): ProjectJSON;
|
|
101
|
+
/**
|
|
102
|
+
* Load clips from JSON
|
|
103
|
+
* @param json The JSON project data
|
|
104
|
+
*/
|
|
105
|
+
loadFromJSON(json: ProjectJSON): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Buffer input data and convert to AudioData with fixed frame count
|
|
109
|
+
* @param framesPerChunk Number of audio frames per AudioData instance
|
|
110
|
+
*/
|
|
111
|
+
export declare function createAudioTrackBuf(framesPerChunk: number): (timestamp: number, trackAudios: Float32Array[][]) => AudioData[];
|