Video Effects SDK 2.6.0.118490 for Windows & macOS
Video Effects SDK 2.6#
Release 2.6.0 for Windows and macOS. Versions 2.4 and 2.5 were iOS-only releases of the Swift package.
IPipeline and IReplacementController are thread-safe#
Any method may be called from any thread without synchronization, except that IPipeline::process must not be called while another process() call is running. Loading a model or creating the engine no longer holds up process().
The same holds for the Obj-C/Swift Pipeline: only one of its process methods may run at a time, and ReplacementController.background may be set from any thread.
Enabling an effect may take a while (it may load a model), so avoid calling enable* methods on the UI thread. Parameter setters such as setColorCorrectionPower are cheap.
Effects#
- New feature
Noise Suppression: Improves video quality by reducing grainy noise in the video and keeps noisy regions stable instead of letting them shimmer from frame to frame. SeeIPipeline::enableNoiseSuppression. - New feature
Portrait Lighting: Highlights the person in the video, with separate controls of the light strength and of the background darkening. SeeIPipeline::enablePortraitLighting,setPortraitLightingParam/getPortraitLightingParamwithPortraitLightingParam. - Reworked
Background Blur: faster and aligned with the Web SDK. - Reworked
Beautification. - Reworked
Color Correctionfor more natural results: automatic scene analysis adapts the image to the lighting and color balance, and manual controls of white balance, exposure, temperature, tint, vibrance and contrast fine-tune it. SeeIPipeline::setColorCorrectionParam/getColorCorrectionParamwithColorCorrectionParam. - Reworked
Low Light: brightens dark scenes without an ML model.
Changes#
- New segmentation models, better and faster: the Quality preset is about 1.75x faster (3.0 ms to 1.7 ms per frame on our test CPU).
- DirectX: NV12 conversion is performed on GPU now.
process()of an NV12 frame on our test discrete GPU (with background replacement enabled): 1920x1080 3.4 ms instead of 15.7 ms, 3840x2160 5.0 ms instead of 54 ms, 7680x4320 12.5 ms instead of 230 ms. - Obj-C/Swift: Added the ability to create
Framewith CVPixelBuffer, seeFrameFactory.newFrame(pixelBuffer:metalCompatible:). - Windows: Improved performance of
IReplacementController::setBackgroundImage: the background is uploaded to GPU without a copy on CPU, NV12 backgrounds are converted on GPU. - Apple: Improved performance of
ReplacementController.background: aCVPixelBufferbackground is used by Metal directly, without a copy, when possible; other frames are converted once per change. - Apple: The Metal pipeline supports RGBA frames created from memory; the processed frame is in memory too, its
toCVPixelBufferreturns nil. - Added Color Range and Color Matrix (BT.601, BT.709) properties in
IFrame:IFrame::setColorRangewithColorRange,IFrame::setColorMatrixwithColorMatrix. On Apple they are taken from theCVPixelBuffer. - Apple: Added
MLBackend::mlBackendGPU, enabled by default: Core ML may run segmentation on the GPU too. To keep the CPU and the Neural Engine only, passmlBackendCPU|mlBackendAppleNeuralEnginetoIPipelineConfiguration::setSegmentationMLBackends(Obj-C/Swift:isSegmentationOnGPUEnabledfalse). - Frame memory is re-used now: output frames of
IPipeline::process()and the copies thatIFrameFactory::createBGRA/createNV12make whenmakeCopyis true come from a pool (on Apple, aCVPixelBufferPool). - New error codes in
PipelineErrorCode:notSupportedByBackend,enabledUnsupportedFeaturesandinvalidUsage. - Windows and macOS: The SDK can be linked directly:
sdk_factory.hdeclarescreateSDKFactory(),tsvb.libis shipped. Loading the library at runtime still works. - Obj-C/Swift: Added
enableNoiseSuppression,enablePortraitLighting, effect settings as typed propertiescolorCorrection(ColorCorrectionSettings) andportraitLighting(PortraitLightingSettings), andisSegmentationOnGPUEnabled. - Obj-C/Swift: Added read-only
isBlurBackgroundEnabled,blurBackgroundPowerandisReplaceBackgroundEnabled. - The API reference is available at https://effectssdk.ai/sdk/desktop/docs/ (C++) and https://effectssdk.ai/sdk/ios/documentation/tsvb/ (Obj-C/Swift).
- Apple: Removed excess dependencies and improved model packing: size of the binaries drastically reduced. macOS
libtsvb.dylib: arm64 14.0 MB to 2.05 MB, x86_64 17.2 MB to 2.08 MB.
Breaking changes#
- Misspelled
enableColorCorrectionWithReferancedeprecated. UseenableColorCorrectionWithReference. - Removed the
segmentationPresetSpeedandsegmentationPresetLightningvalues ofSegmentationPreset(Obj-C/Swift:speedandlightningofSegmentationPreset). - Removed the old background denoise effect, replaced by
Noise Suppression:enableDenoiseBackground,disableBackgroundDenoise,setDenoisePower/getDenoisePower,setDenoiseWithFace/getDenoiseWithFaceandgetDenoiseBackgroundStateofIPipeline(Obj-C/Swift:enableDenoiseBackground,disableDenoiseBackground,denoisePoweranddenoiseWithFace). Beautification,Color Correction,Low Lightdo not work on CPU anymore: enabling them on the CPU backend returnsnotSupportedByBackend. Code that checked forengineInitializationErrorthere has to check fornotSupportedByBackendnow.- macOS x86_64: The minimum macOS version is 11.0 instead of 10.15, as for arm64.
PipelineErrorCode::invalidArguemntis renamed toinvalidArgument.IReplacementController::setBackgroundImage(Obj-C/Swiftbackground) does not copy the frame anymore: don't release a frame created withmakeCopyfalse while it is the background.- Windows: With background replacement and no background image, the background of an NV12 frame is black, as on Apple.
Fixes#
IFrameFactory::createNV12withmakeCopyread past the end of the UV plane and could crash.- Windows:
tsvb.dllis unloaded byFreeLibrary; it used to stay loaded with idle threads until the process exited. - Windows x86:
Smart Zoomworks again;enableSmartZoomfailed withengineInitializationError. - Windows and CPU backend: The processed frame keeps the rotation of the input frame.
- Apple: Fixed a socket leak on each authorization request.
Color FilterandColor Grading: wrong colors for a few frames after changing the LUT or switching from CPU to GPU backend.IFrame::lock()on the background image duringprocess()could get a cleared data pointer.IFrameFactory::loadImageandloadImageWithDatareturn nullptr for a null argument instead of crashing.- Swift:
await factory.auth(customerID:)never returned when authorization failed before the web request. - Obj-C: Fixed memory leaks in
newPipeline, failed authorization andenableReplaceBackground:. - Obj-C:
colorCorrectionPowerreturns the actual value. - Obj-C:
newFrameWithFormat:with NV12 returns nil instead of reading invalid memory; pass NV12 asCVPixelBuffer.
Sample#
The sample is reworked: it uses Qt QML now, with an updated design.
- Camera capture is reworked on native APIs: Media Foundation on Windows, AVFoundation on macOS.
- The SDK usage is reworked to demonstrate a more efficient path: camera frames go to the SDK and to the screen without conversions and copies on CPU (NV12 on Windows,
CVPixelBufferon macOS). - Clearer error messages.