canUseVideoMatting()v4.0.523
Checks whether a video matting model can run in the current browser.
This function checks WebGPU and model-specific requirements. It does not inspect an input file or check video decoding and encoding support.
support.tsimport {canUseVideoMatting } from '@remotion/video-matting'; constresult = awaitcanUseVideoMatting ({model : 'modnet'}); if (!result .supported ) { throw newError (result .detailedReason ); }
Options
model?
The model whose requirements should be checked. Default: modnet.
Return value
A promise resolving to a discriminated result with these properties:
supported
true if the selected model is supported and false otherwise.
reason?
When supported is false, one of:
window-undefinedwebgpu-unavailablewebgpu-requires-secure-contextshader-f16-unavailable
shader-f16-unavailable applies to models such as ben2-base that require 16-bit shader support.
detailedReason?
When supported is false, a human-readable explanation of the reason.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||