@pexip/media 20.3.4 → 21.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/CHANGELOG.md +71 -0
- package/api-docs/README.mdx +406 -0
- package/api-docs/enumerations/DeniedDevices.mdx +7 -0
- package/api-docs/enumerations/UserMediaStatus.mdx +49 -0
- package/api-docs/functions/applyContentHint.mdx +33 -0
- package/api-docs/functions/createAudioMixingProcess.mdx +20 -0
- package/api-docs/functions/createAudioStreamProcess.mdx +15 -0
- package/api-docs/functions/createGetDisplayMedia.mdx +26 -0
- package/api-docs/functions/createMedia.mdx +20 -0
- package/api-docs/functions/createMediaSignal.mdx +42 -0
- package/api-docs/functions/createMediaSignals.mdx +33 -0
- package/api-docs/functions/createPreviewStreamController.mdx +13 -0
- package/api-docs/functions/createVideoStreamProcess.mdx +13 -0
- package/api-docs/functions/deriveInitialPermissionStatus.mdx +14 -0
- package/api-docs/functions/getBlurKernelSize.mdx +25 -0
- package/api-docs/functions/getPermissionStatus.mdx +34 -0
- package/api-docs/functions/getTentBlurSize.mdx +24 -0
- package/api-docs/functions/isAnalyzerNodeInitProp.mdx +13 -0
- package/api-docs/functions/isAudioContentHint.mdx +13 -0
- package/api-docs/functions/isMedia.mdx +13 -0
- package/api-docs/functions/isNonNullObject.mdx +13 -0
- package/api-docs/functions/isUserMediaStatus.mdx +13 -0
- package/api-docs/functions/isVideoContentHint.mdx +13 -0
- package/api-docs/functions/isVideoStreamTrackProcessorAPIs.mdx +13 -0
- package/api-docs/functions/setLogger.mdx +13 -0
- package/api-docs/functions/toDeniedDevices.mdx +13 -0
- package/api-docs/interfaces/AudioDetectionSignals.mdx +6 -0
- package/api-docs/interfaces/AudioSignalDetectionOptions.mdx +6 -0
- package/api-docs/interfaces/DenoiseParams.mdx +9 -0
- package/api-docs/interfaces/ExtendedMediaTrackSettings.mdx +38 -0
- package/api-docs/interfaces/Media.mdx +316 -0
- package/api-docs/interfaces/MediaAttributes.mdx +19 -0
- package/api-docs/interfaces/MediaChangesSignals.mdx +15 -0
- package/api-docs/interfaces/MediaController.mdx +11 -0
- package/api-docs/interfaces/MediaInit.mdx +14 -0
- package/api-docs/interfaces/MediaOptions.mdx +10 -0
- package/api-docs/interfaces/MediaProps.mdx +9 -0
- package/api-docs/interfaces/MediaSettings.mdx +6 -0
- package/api-docs/interfaces/MediaTrack.mdx +121 -0
- package/api-docs/interfaces/MediaTrackInit.mdx +29 -0
- package/api-docs/interfaces/PreviewControllerProps.mdx +14 -0
- package/api-docs/interfaces/PreviewEventHandler.mdx +19 -0
- package/api-docs/interfaces/PreviewStreamController.mdx +350 -0
- package/api-docs/interfaces/PreviewStreamParams.mdx +15 -0
- package/api-docs/interfaces/VoiceActivityDetectionOptions.mdx +6 -0
- package/api-docs/type-aliases/AudioContentHint.mdx +3 -0
- package/api-docs/type-aliases/CreatePreviewStreamController.mdx +3 -0
- package/api-docs/type-aliases/ExtendedMediaTrackSettingsKey.mdx +3 -0
- package/api-docs/type-aliases/GeneratedMediaSignals.mdx +9 -0
- package/api-docs/type-aliases/GetDisplayMedia.mdx +3 -0
- package/api-docs/type-aliases/GetUserMediaProcess.mdx +19 -0
- package/api-docs/type-aliases/MediaSignals.mdx +3 -0
- package/api-docs/type-aliases/MediaSignalsOptional.mdx +3 -0
- package/api-docs/type-aliases/MediaSignalsRequired.mdx +3 -0
- package/api-docs/type-aliases/PreviewInput.mdx +3 -0
- package/api-docs/type-aliases/Process.mdx +19 -0
- package/api-docs/type-aliases/Segmenters.mdx +3 -0
- package/api-docs/type-aliases/TrackProcessor.mdx +3 -0
- package/api-docs/type-aliases/Unsubscribe.mdx +7 -0
- package/api-docs/type-aliases/UserMediaValidator.mdx +13 -0
- package/api-docs/type-aliases/VideoContentHint.mdx +3 -0
- package/api-docs/type-aliases/VideoRenderParams.mdx +17 -0
- package/api-docs/type-aliases/VideoStreamTrackProcessorAPIs.mdx +7 -0
- package/api-docs/variables/AUDIO_CONTENT_HINTS.mdx +17 -0
- package/api-docs/variables/REQUIRED_SIGNAL_KEYS.mdx +3 -0
- package/api-docs/variables/VIDEO_CONTENT_HINTS.mdx +17 -0
- package/api-docs/variables/areBothGranted.mdx +3 -0
- package/api-docs/variables/hasNoAudioDevices.mdx +3 -0
- package/api-docs/variables/hasNoDevice.mdx +3 -0
- package/api-docs/variables/hasNoVideoDevices.mdx +3 -0
- package/api-docs/variables/internalSignals.mdx +13 -0
- package/api-docs/variables/isAudioDeviceInUse.mdx +3 -0
- package/api-docs/variables/isDeviceInUse.mdx +3 -0
- package/api-docs/variables/isDevicesInUse.mdx +3 -0
- package/api-docs/variables/isFallback.mdx +3 -0
- package/api-docs/variables/isFallbackAudio.mdx +3 -0
- package/api-docs/variables/isFallbackVideo.mdx +3 -0
- package/api-docs/variables/isGranted.mdx +3 -0
- package/api-docs/variables/isGrantedAudio.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyAudio.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyAudioNoVideoDevices.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyVideo.mdx +3 -0
- package/api-docs/variables/isGrantedOnlyVideoNoAudioDevices.mdx +3 -0
- package/api-docs/variables/isGrantedVideo.mdx +3 -0
- package/api-docs/variables/isInitial.mdx +3 -0
- package/api-docs/variables/isInitialPermissions.mdx +3 -0
- package/api-docs/variables/isInitialPermissionsGranted.mdx +3 -0
- package/api-docs/variables/isInitialPermissionsNotGranted.mdx +3 -0
- package/api-docs/variables/isOnlyAudioError.mdx +3 -0
- package/api-docs/variables/isOnlyVideoError.mdx +3 -0
- package/api-docs/variables/isOverConstrained.mdx +3 -0
- package/api-docs/variables/isPromptAudio.mdx +3 -0
- package/api-docs/variables/isPromptVideo.mdx +3 -0
- package/api-docs/variables/isRejected.mdx +3 -0
- package/api-docs/variables/isRejectedOnlyAudio.mdx +3 -0
- package/api-docs/variables/isRejectedOnlyVideo.mdx +3 -0
- package/api-docs/variables/isRequestPermissionNeeded.mdx +3 -0
- package/api-docs/variables/isUnknownError.mdx +3 -0
- package/api-docs/variables/isVideoDeviceInUse.mdx +3 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/previewController.js +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/userMedia.d.ts +4 -1
- package/dist/userMedia.js +15 -11
- package/dist/utils.d.ts +17 -6
- package/dist/utils.js +27 -13
- package/dist/videoProcessor.d.ts +3 -3
- package/dist/videoProcessor.js +172 -30
- package/package.json +17 -12
package/dist/videoProcessor.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createCanvasTransform, createVideoProcessor, createVideoTrackProcessor, createVideoTrackProcessorWithFallback, isRenderEffects, isSegmentationModel, } from '@pexip/media-processor';
|
|
2
2
|
import { extractConstraintsWithKeys, getValueFromConstrainNumber, muteStreamTrack, } from '@pexip/media-control';
|
|
3
3
|
import { isEmpty, assert } from '@pexip/utils';
|
|
4
|
-
import { createMediaTrack, getBlurKernelSize } from './utils';
|
|
4
|
+
import { createMediaTrack, getBlurKernelSize, getTentBlurSize } from './utils';
|
|
5
5
|
import { logger, proxyWithLog } from './logger';
|
|
6
6
|
import { isVideoContentHint } from './typeGuard';
|
|
7
7
|
import { PROCESSOR_LABELS } from './constants';
|
|
8
8
|
const FEATURE_KEYS = [
|
|
9
9
|
'backgroundBlurAmount',
|
|
10
10
|
'backgroundImageUrl',
|
|
11
|
+
'backgroundThreshold',
|
|
11
12
|
'maskCombineRatio',
|
|
12
13
|
'edgeBlurAmount',
|
|
13
14
|
'foregroundThreshold',
|
|
@@ -20,6 +21,20 @@ const FEATURE_KEYS = [
|
|
|
20
21
|
'tilt',
|
|
21
22
|
'zoom',
|
|
22
23
|
'contentHint',
|
|
24
|
+
'sigmaSpace',
|
|
25
|
+
'sigmaRangeLo',
|
|
26
|
+
'sigmaRangeHi',
|
|
27
|
+
'excludeBystanders',
|
|
28
|
+
'personCenterX',
|
|
29
|
+
'personCenterY',
|
|
30
|
+
'morphErodeRadiusPx',
|
|
31
|
+
'morphPass',
|
|
32
|
+
'morphDilateRadiusPx',
|
|
33
|
+
'lightWrapIntensity',
|
|
34
|
+
'lightWrapTightness',
|
|
35
|
+
'lightWrapEdgeBand',
|
|
36
|
+
'lightWrapBlurAmount',
|
|
37
|
+
'downSampleFactor',
|
|
23
38
|
];
|
|
24
39
|
const getVideoConstraints = extractConstraintsWithKeys(FEATURE_KEYS);
|
|
25
40
|
export const updateFeatureProps = (constraints, props) => {
|
|
@@ -62,13 +77,27 @@ export const updateFeatureProps = (constraints, props) => {
|
|
|
62
77
|
}
|
|
63
78
|
return accm;
|
|
64
79
|
}
|
|
65
|
-
case '
|
|
66
|
-
case '
|
|
67
|
-
case '
|
|
68
|
-
case 'foregroundThreshold':
|
|
80
|
+
case 'backgroundBlurAmount':
|
|
81
|
+
case 'backgroundThreshold':
|
|
82
|
+
case 'downSampleFactor':
|
|
69
83
|
case 'edgeBlurAmount':
|
|
84
|
+
case 'foregroundThreshold':
|
|
85
|
+
case 'frameRate':
|
|
86
|
+
case 'height':
|
|
87
|
+
case 'lightWrapBlurAmount':
|
|
88
|
+
case 'lightWrapEdgeBand':
|
|
89
|
+
case 'lightWrapIntensity':
|
|
90
|
+
case 'lightWrapTightness':
|
|
70
91
|
case 'maskCombineRatio':
|
|
71
|
-
case '
|
|
92
|
+
case 'morphDilateRadiusPx':
|
|
93
|
+
case 'morphErodeRadiusPx':
|
|
94
|
+
case 'morphPass':
|
|
95
|
+
case 'personCenterX':
|
|
96
|
+
case 'personCenterY':
|
|
97
|
+
case 'sigmaRangeHi':
|
|
98
|
+
case 'sigmaRangeLo':
|
|
99
|
+
case 'sigmaSpace':
|
|
100
|
+
case 'width': {
|
|
72
101
|
const [feature] = extracted[key];
|
|
73
102
|
if (feature !== undefined) {
|
|
74
103
|
const value = getValueFromConstrainNumber(feature);
|
|
@@ -96,23 +125,68 @@ export const updateFeatureProps = (constraints, props) => {
|
|
|
96
125
|
}
|
|
97
126
|
}, {});
|
|
98
127
|
};
|
|
99
|
-
const applyFeatures = (transformer, features,
|
|
128
|
+
const applyFeatures = (transformer, features, referenceProcessingHeight) => {
|
|
100
129
|
for (const key in features) {
|
|
101
130
|
const k = key;
|
|
102
131
|
switch (k) {
|
|
103
|
-
case 'edgeBlurAmount':
|
|
104
132
|
case 'maskCombineRatio':
|
|
105
|
-
case 'foregroundThreshold':
|
|
133
|
+
case 'foregroundThreshold':
|
|
134
|
+
case 'sigmaSpace':
|
|
135
|
+
case 'sigmaRangeLo':
|
|
136
|
+
case 'sigmaRangeHi':
|
|
137
|
+
case 'morphErodeRadiusPx':
|
|
138
|
+
case 'morphPass':
|
|
139
|
+
case 'morphDilateRadiusPx':
|
|
140
|
+
case 'lightWrapIntensity':
|
|
141
|
+
case 'lightWrapTightness':
|
|
142
|
+
case 'lightWrapEdgeBand':
|
|
143
|
+
case 'downSampleFactor':
|
|
144
|
+
case 'backgroundThreshold': {
|
|
145
|
+
const value = features[k];
|
|
146
|
+
if (value !== undefined) {
|
|
147
|
+
transformer[k] = value;
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case 'excludeBystanders': {
|
|
106
152
|
const value = features[k];
|
|
107
153
|
if (value !== undefined) {
|
|
108
154
|
transformer[k] = value;
|
|
109
155
|
}
|
|
110
156
|
break;
|
|
111
157
|
}
|
|
158
|
+
case 'personCenterX': {
|
|
159
|
+
const value = features[k];
|
|
160
|
+
if (value !== undefined) {
|
|
161
|
+
transformer.personCenter = [
|
|
162
|
+
value,
|
|
163
|
+
transformer.personCenter[1],
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 'personCenterY': {
|
|
169
|
+
const value = features[k];
|
|
170
|
+
if (value !== undefined) {
|
|
171
|
+
transformer.personCenter = [
|
|
172
|
+
transformer.personCenter[0],
|
|
173
|
+
value,
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case 'lightWrapBlurAmount':
|
|
112
179
|
case 'backgroundBlurAmount': {
|
|
113
180
|
const value = features[k];
|
|
114
181
|
if (value !== undefined) {
|
|
115
|
-
transformer[k] = getBlurKernelSize(value, transformer.height,
|
|
182
|
+
transformer[k] = getBlurKernelSize(value, referenceProcessingHeight ?? transformer.height, transformer.height);
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case 'edgeBlurAmount': {
|
|
187
|
+
const value = features[k];
|
|
188
|
+
if (value !== undefined) {
|
|
189
|
+
transformer[k] = getTentBlurSize(value, referenceProcessingHeight ?? transformer.height, transformer.height);
|
|
116
190
|
}
|
|
117
191
|
break;
|
|
118
192
|
}
|
|
@@ -143,28 +217,47 @@ const getTrackProcessor = (shouldUseStreamTrackProcessor, ...params) => {
|
|
|
143
217
|
}
|
|
144
218
|
return createVideoTrackProcessorWithFallback(...params);
|
|
145
219
|
};
|
|
146
|
-
export const createVideoStreamProcess = ({ backgroundImageUrl, dynamicProcessingDimensions = () => false,
|
|
147
|
-
label = PROCESSOR_LABELS.VideoProcessor,
|
|
220
|
+
export const createVideoStreamProcess = ({ backgroundImageUrl, dynamicProcessingDimensions = () => false, backgroundThreshold, downSampleFactor, foregroundThreshold, lightWrapEdgeBand, lightWrapIntensity, lightWrapTightness, morphDilateRadiusPx, morphErodeRadiusPx, morphPass, personCenterX, personCenterY, sigmaSpace, sigmaRangeHi, sigmaRangeLo, frameRate, gpuAPI = () => 'webgl', // dynamically changing the config will not be picked up, not a priority for now
|
|
221
|
+
label = PROCESSOR_LABELS.VideoProcessor, referenceProcessingHeight, maskCombineRatio, processingHeight, processingWidth, shouldEnable, stopAsMute = () => false, trackProcessorAPI = () => 'stream', videoSegmentation, signals, ...options }) => {
|
|
148
222
|
const videoSegmentationModel = options.videoSegmentationModel ?? 'selfie';
|
|
149
223
|
const segmenter = options.segmenters[videoSegmentationModel];
|
|
150
224
|
if (!segmenter) {
|
|
151
225
|
throw new Error('Segmenter is undefined');
|
|
152
226
|
}
|
|
153
227
|
const backgroundBlurAmount = options.backgroundBlurAmount &&
|
|
154
|
-
getBlurKernelSize(options.backgroundBlurAmount, processingHeight,
|
|
228
|
+
getBlurKernelSize(options.backgroundBlurAmount, referenceProcessingHeight ?? processingHeight, processingHeight);
|
|
229
|
+
const lightWrapBlurAmount = options.lightWrapBlurAmount &&
|
|
230
|
+
getBlurKernelSize(options.lightWrapBlurAmount, referenceProcessingHeight ?? processingHeight, processingHeight);
|
|
231
|
+
const edgeBlurAmount = options.edgeBlurAmount &&
|
|
232
|
+
getTentBlurSize(options.edgeBlurAmount, referenceProcessingHeight ?? processingHeight, processingHeight);
|
|
155
233
|
const transformer = options.transformer ??
|
|
156
234
|
createCanvasTransform(segmenter, {
|
|
157
|
-
width: processingWidth,
|
|
158
|
-
height: processingHeight,
|
|
159
|
-
effects: videoSegmentation,
|
|
160
|
-
foregroundThreshold,
|
|
161
235
|
backgroundBlurAmount,
|
|
162
|
-
edgeBlurAmount,
|
|
163
236
|
backgroundImageUrl,
|
|
237
|
+
backgroundThreshold,
|
|
238
|
+
downSampleFactor,
|
|
239
|
+
edgeBlurAmount,
|
|
240
|
+
effects: videoSegmentation,
|
|
241
|
+
foregroundThreshold,
|
|
242
|
+
height: processingHeight,
|
|
243
|
+
lightWrapBlurAmount,
|
|
244
|
+
lightWrapEdgeBand,
|
|
245
|
+
lightWrapIntensity,
|
|
246
|
+
lightWrapTightness,
|
|
164
247
|
maskCombineRatio,
|
|
248
|
+
morphDilateRadiusPx,
|
|
249
|
+
morphErodeRadiusPx,
|
|
250
|
+
morphPass,
|
|
251
|
+
personCenter: personCenterX !== undefined && personCenterY !== undefined
|
|
252
|
+
? [personCenterX, personCenterY]
|
|
253
|
+
: undefined,
|
|
254
|
+
sigmaRangeHi,
|
|
255
|
+
sigmaRangeLo,
|
|
256
|
+
sigmaSpace,
|
|
257
|
+
width: processingWidth,
|
|
165
258
|
});
|
|
166
259
|
const proxy = proxyWithLog(logger, label);
|
|
167
|
-
let _videoProcessor
|
|
260
|
+
let _videoProcessor;
|
|
168
261
|
const props = {
|
|
169
262
|
videoSegmentationModel,
|
|
170
263
|
segmenters: {
|
|
@@ -186,11 +279,25 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
186
279
|
},
|
|
187
280
|
videoSegmentation,
|
|
188
281
|
backgroundBlurAmount,
|
|
282
|
+
backgroundImageUrl,
|
|
283
|
+
backgroundThreshold,
|
|
284
|
+
downSampleFactor,
|
|
189
285
|
edgeBlurAmount,
|
|
190
286
|
foregroundThreshold,
|
|
191
287
|
frameRate,
|
|
192
|
-
|
|
288
|
+
lightWrapBlurAmount,
|
|
289
|
+
lightWrapEdgeBand,
|
|
290
|
+
lightWrapIntensity,
|
|
291
|
+
lightWrapTightness,
|
|
193
292
|
maskCombineRatio,
|
|
293
|
+
morphDilateRadiusPx,
|
|
294
|
+
morphErodeRadiusPx,
|
|
295
|
+
morphPass,
|
|
296
|
+
personCenterX,
|
|
297
|
+
personCenterY,
|
|
298
|
+
sigmaRangeHi,
|
|
299
|
+
sigmaRangeLo,
|
|
300
|
+
sigmaSpace,
|
|
194
301
|
hasInitialized: options.hasInitializedDeps ?? false,
|
|
195
302
|
};
|
|
196
303
|
return async (prevMediaTrack) => {
|
|
@@ -227,7 +334,16 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
227
334
|
});
|
|
228
335
|
if (props.backgroundBlurAmount !== undefined) {
|
|
229
336
|
props.transformer.backgroundBlurAmount =
|
|
230
|
-
getBlurKernelSize(props.backgroundBlurAmount,
|
|
337
|
+
getBlurKernelSize(props.backgroundBlurAmount, referenceProcessingHeight ??
|
|
338
|
+
processingHeight, height);
|
|
339
|
+
}
|
|
340
|
+
if (props.lightWrapBlurAmount !== undefined) {
|
|
341
|
+
props.transformer.lightWrapBlurAmount =
|
|
342
|
+
getBlurKernelSize(props.lightWrapBlurAmount, referenceProcessingHeight ??
|
|
343
|
+
processingHeight, height);
|
|
344
|
+
}
|
|
345
|
+
if (props.edgeBlurAmount !== undefined) {
|
|
346
|
+
props.transformer.edgeBlurAmount = getTentBlurSize(props.edgeBlurAmount, referenceProcessingHeight ?? processingHeight, height);
|
|
231
347
|
}
|
|
232
348
|
}
|
|
233
349
|
}
|
|
@@ -238,7 +354,7 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
238
354
|
}
|
|
239
355
|
props.hasInitialized = true;
|
|
240
356
|
}
|
|
241
|
-
applyFeatures(props.transformer, features,
|
|
357
|
+
applyFeatures(props.transformer, features, referenceProcessingHeight);
|
|
242
358
|
const model = features.videoSegmentationModel &&
|
|
243
359
|
props.segmenters[features.videoSegmentationModel];
|
|
244
360
|
if (features.videoSegmentationModel &&
|
|
@@ -318,7 +434,7 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
318
434
|
if (isEmpty(features)) {
|
|
319
435
|
return;
|
|
320
436
|
}
|
|
321
|
-
applyFeatures(props.transformer, features,
|
|
437
|
+
applyFeatures(props.transformer, features, referenceProcessingHeight);
|
|
322
438
|
if (dynamicProcessingDimensions()) {
|
|
323
439
|
const acceptedSettings = this.previousMediaTrack?.source.getSettings();
|
|
324
440
|
if (acceptedSettings?.width && acceptedSettings?.height) {
|
|
@@ -328,7 +444,16 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
328
444
|
});
|
|
329
445
|
if (props.backgroundBlurAmount !== undefined) {
|
|
330
446
|
props.transformer.backgroundBlurAmount =
|
|
331
|
-
getBlurKernelSize(props.backgroundBlurAmount,
|
|
447
|
+
getBlurKernelSize(props.backgroundBlurAmount, referenceProcessingHeight ??
|
|
448
|
+
processingHeight, acceptedSettings.height);
|
|
449
|
+
}
|
|
450
|
+
if (props.lightWrapBlurAmount !== undefined) {
|
|
451
|
+
props.transformer.lightWrapBlurAmount =
|
|
452
|
+
getBlurKernelSize(props.lightWrapBlurAmount, referenceProcessingHeight ??
|
|
453
|
+
processingHeight, acceptedSettings.height);
|
|
454
|
+
}
|
|
455
|
+
if (props.edgeBlurAmount !== undefined) {
|
|
456
|
+
props.transformer.edgeBlurAmount = getTentBlurSize(props.edgeBlurAmount, referenceProcessingHeight ?? processingHeight, acceptedSettings.height);
|
|
332
457
|
}
|
|
333
458
|
}
|
|
334
459
|
}
|
|
@@ -343,18 +468,35 @@ label = PROCESSOR_LABELS.VideoProcessor, lowestProcessingHeight, maskCombineRati
|
|
|
343
468
|
getSettings: () => {
|
|
344
469
|
const contentHint = track.contentHint ?? '';
|
|
345
470
|
return {
|
|
346
|
-
videoSegmentation: transformer.effects,
|
|
347
|
-
foregroundThreshold: transformer.foregroundThreshold,
|
|
348
|
-
// Background blur amount is a function of height
|
|
349
471
|
backgroundBlurAmount: props.backgroundBlurAmount,
|
|
472
|
+
backgroundImageUrl: transformer.backgroundImageUrl,
|
|
473
|
+
backgroundThreshold: transformer.backgroundThreshold,
|
|
474
|
+
contentHint,
|
|
475
|
+
downSampleFactor: transformer.downSampleFactor,
|
|
350
476
|
edgeBlurAmount: transformer.edgeBlurAmount,
|
|
477
|
+
excludeBystanders: transformer.excludeBystanders,
|
|
478
|
+
foregroundThreshold: transformer.foregroundThreshold,
|
|
479
|
+
frameRate: props.frameRate,
|
|
480
|
+
height: props.height,
|
|
481
|
+
lightWrapBlurAmount: transformer.lightWrapBlurAmount,
|
|
482
|
+
lightWrapEdgeBand: transformer.lightWrapEdgeBand,
|
|
483
|
+
lightWrapIntensity: transformer.lightWrapIntensity,
|
|
484
|
+
lightWrapTightness: transformer.lightWrapTightness,
|
|
351
485
|
maskCombineRatio: transformer.maskCombineRatio,
|
|
352
|
-
|
|
353
|
-
|
|
486
|
+
morphDilateRadiusPx: transformer.morphDilateRadiusPx,
|
|
487
|
+
morphErodeRadiusPx: transformer.morphErodeRadiusPx,
|
|
488
|
+
morphPass: transformer.morphPass,
|
|
354
489
|
pan: props.pan,
|
|
490
|
+
personCenterX: transformer.personCenter[0],
|
|
491
|
+
personCenterY: transformer.personCenter[1],
|
|
492
|
+
sigmaRangeHi: transformer.sigmaRangeHi,
|
|
493
|
+
sigmaRangeLo: transformer.sigmaRangeLo,
|
|
494
|
+
sigmaSpace: transformer.sigmaSpace,
|
|
355
495
|
tilt: props.tilt,
|
|
496
|
+
videoSegmentation: transformer.effects,
|
|
497
|
+
videoSegmentationModel: transformer.segmenter.modelAsset.modelName,
|
|
498
|
+
width: props.width,
|
|
356
499
|
zoom: props.zoom,
|
|
357
|
-
contentHint,
|
|
358
500
|
};
|
|
359
501
|
},
|
|
360
502
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pexip/media",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Home for media related stuff",
|
|
5
|
-
"homepage": "https://
|
|
5
|
+
"homepage": "https://developer.pexip.com",
|
|
6
6
|
"bugs": "https://gitlab.com/pexip/zoo/issues",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -26,37 +26,42 @@
|
|
|
26
26
|
},
|
|
27
27
|
"directories": {
|
|
28
28
|
"lib": "lib",
|
|
29
|
-
"test": "__tests__"
|
|
29
|
+
"test": "__tests__",
|
|
30
|
+
"doc": "api-docs"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
|
-
"dist"
|
|
33
|
+
"dist",
|
|
34
|
+
"api-docs"
|
|
33
35
|
],
|
|
34
36
|
"scripts": {
|
|
35
37
|
"build": "pexip-bundler build",
|
|
36
38
|
"build:sourcemap": "pexip-bundler build --sourcemap",
|
|
37
|
-
"clean": "rm -fr dist",
|
|
39
|
+
"clean": "rm -fr dist api-docs",
|
|
38
40
|
"dev": "pexip-bundler dev",
|
|
39
|
-
"prepack": "yarn clean && yarn build",
|
|
41
|
+
"prepack": "yarn clean && yarn build && yarn docs",
|
|
40
42
|
"test": "jest",
|
|
41
43
|
"check-format": "prettier --ignore-path=../../.prettierignore --check .",
|
|
42
44
|
"format": "prettier --ignore-path=../../.prettierignore --write .",
|
|
43
45
|
"lint": "yarn run -T biome lint",
|
|
44
|
-
"typecheck": "yarn tsc --noEmit -p ."
|
|
46
|
+
"typecheck": "yarn tsc --noEmit -p .",
|
|
47
|
+
"docs": "typedoc"
|
|
45
48
|
},
|
|
46
49
|
"dependencies": {
|
|
47
|
-
"@pexip/media-control": "
|
|
48
|
-
"@pexip/media-processor": "
|
|
49
|
-
"@pexip/signal": "16.9.
|
|
50
|
-
"@pexip/utils": "17.
|
|
50
|
+
"@pexip/media-control": "21.0.0",
|
|
51
|
+
"@pexip/media-processor": "21.0.0",
|
|
52
|
+
"@pexip/signal": "16.9.4",
|
|
53
|
+
"@pexip/utils": "17.2.0"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@jest/globals": "^30.2.0",
|
|
54
|
-
"@pexip/bundler": "18.
|
|
57
|
+
"@pexip/bundler": "18.2.0",
|
|
55
58
|
"@swc/core": "^1.10.12",
|
|
56
59
|
"@swc/jest": "^0.2.39",
|
|
57
60
|
"jest": "^29.5.12",
|
|
58
61
|
"jest-junit": "^16.0.0",
|
|
59
62
|
"prettier": "^3.2.5",
|
|
63
|
+
"typedoc": "^0.28.15",
|
|
64
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
60
65
|
"typescript": "~5.7.3"
|
|
61
66
|
},
|
|
62
67
|
"publishConfig": {
|