|
Video Effects SDK 2.6.0.118490
AI-powered SDK for real-time video enhancement.
|
Add real-time AI video enhancement to your application in a few hours and make the video meeting experience more effective and comfortable. This reference describes the C++ API of the SDK: see Features for what it can do and Usage details to get started.
To receive a license, fill in the contact form.
The entry point of the SDK is the instance of tsvb::ISDKFactory. Using an ISDKFactory instance you will be able to prepare frames for processing and configure the pipeline of processing (enable transparency, blur, replace background etc.).
On macOS, linked with libtsvb.dylib, and on Windows, linked with tsvb.lib:
See sdk_library_handler_win.cpp and sdk_library_handler_unix.cpp in the sample for the complete code.
On Windows and Linux a library loaded at run time is unloaded once its last handle is freed with FreeLibrary() or dlclose(). Free it only after every object obtained from it is released. Linked with tsvb.lib, tsvb.dll stays loaded until the process exits.
On macOS dlclose() leaves libtsvb.dylib loaded: the system never unloads a library that contains Objective-C code, and the SDK uses it for Metal and Core ML. A later dlopen() in the same process returns the same, already initialized library. Memory, threads and models held by the SDK are freed when its objects are released, not when the library is closed.
All objects created by the SDK implement tsvb::IRelease. The IRelease interface provides a tsvb::IRelease::release() method which releases the memory that was allocated for the object. The release() method should be called explicitly when such an object must be destroyed.
Don’t use operator delete for the SDK objects.
To have std::unique_ptr or std::shared_ptr release them, see Smart pointers.
Preparation:
Frame processing:
On Apple platforms you can use CVPixelBuffer for better performance. See tsvb::IAppleCompatFrameFactory.
Use separate tsvb::IPipeline instances per video stream.
tsvb::IPipeline and tsvb::IReplacementController are thread-safe: process frames on the video thread and turn effects on and off or change their settings from the GUI thread (or any other), with no lock of your own. tsvb::IPipeline::process() may be called from any thread too, but not while another tsvb::IPipeline::process() call is running: pass the frames of a stream one after another, in their order.
For more usage details see sample_controller.cpp, which sets the effects up, and video_filter.cpp, which processes the frames, in the sample.