Skip to content

Video Effects SDK for Windows and macOS

Integrate the C++ Video Effects SDK into a Windows or macOS app: create a pipeline, enable effects and process BGRA or NV12 frames.

The desktop SDK is a C++ library for Windows 10/11 x64 (x86 apps are supported on 64-bit Windows) and macOS 11.0+ on Apple silicon and Intel. It processes BGRA and NV12 frames on the GPU (DirectX 11, Metal) with a CPU fallback.

Before you start#

Register in the Developer Portal, start a trial for Windows or macOS and download the SDK from the desktop-demo-samples releases.

Create the factory#

::tsvb::ISDKFactory* createFactory()
{
    HMODULE module = ::LoadLibrary("tsvb");
    auto createSDKFactory = reinterpret_cast<::tsvb::pfnCreateSDKFactory>(
        GetProcAddress(module, "createSDKFactory"));
    return createSDKFactory(); // may return NULL
}

Create a pipeline and enable effects#

::tsvb::ISDKFactory* factory = createFactory();
::tsvb::IFrameFactory* frameFactory = factory->createFrameFactory();
::tsvb::IPipeline* pipeline = factory->createPipeline();
factory->release();

pipeline->enableBlurBackground(0.6f);      // 0…1
// pipeline->enableReplaceBackground(&replacementController);
// pipeline->enableBeautification();
// pipeline->enableSmartZoom();
// pipeline->enableColorCorrection();

Process frames#

::tsvb::IFrame* frame = frameFactory->createBGRA(data, bytesPerLine, width, height, false);
::tsvb::IFrame* result = pipeline->process(frame, nullptr); // same format as the input

Use createNV12() for NV12 input. With makeCopy = false the frame keeps a pointer to your buffer, so do not free it while processing. Create one IPipeline per video stream.

Memory#

Every SDK object implements IRelease: call release() when you are done, never delete.

frameFactory->release();
pipeline->release();

Next steps#

View as Markdown · Found a problem? Tell us.