Output video freezes on effects switching

We create a video stream from banuba’s PixelBuffer output using Player manual rendering API.

When switching effects, banuba takes some time to initialize a new effect. In this time onPresent callback is never called and video freezes.

How can we work around this?

Hi Daniil,

Make sure that you are loading the effect synchronously within the load method:

(effect: ..., synchronous: true))

Also, please check that you are calling onPresent on every render() call from Player.

Yes, we do all of the things you’ve mentioned. But sill get freezing. It only happens on first time of opening effects.

What are the effects you are using then and on which devices? Its quite likely some Neural Networks are loading and its longer than necessary for some reason (weak device?).

Device: WP19 (Android 12 phone)
Happens with more or less every effect. For example: Afro, Arabic night, etc.

There is a high chance this is device connected if its is this device. Its a relatively weak device and likely unable to provide the SDK with all necessary resources. We recommend trying on a more mainline device from 2022 - 2023.

Yes, it could be the case. But why Player doesn’t pass raw frames while effect is loading? This would be more desirable behaviour than freezing

According to logs, it takes almost 2 second to load and activate (mostly activate) effect on first time.

  1. Log for loading effect
2024-01-17 19:04:05.362 29440-29577 bnb_sdk  com.chatroulette.android  I [bnb_sdk|19:04:05|INFO][effect_manager] Trying to load effect: Afro
  1. Log for effect activation (after 411ms)
2024-01-17 19:04:05.773 29440-30147 bnb_sdk com.chatroulette.android I [bnb_sdk|19:04:05|INFO][effect_manager] Trying to activate effect: Afro
  1. Last log for effect (after yet another 1438ms)
2024-01-17 19:04:07.216 29440-30138 bnb_sdk com.chatroulette.android I [bnb_sdk|19:04:07|INFO][EyesClosedTrigger] construct

Daniil,
Effect loading is a very resource heavy operation, that we strive to load as fast as possible (condensed in just a few seconds)… hence a freeze can occur on weak devices as I mentioned before. While in theory if this load was stretched out over a longer period - then perhaps a freeze would not occur, but obviously you would be left without an effect for longer…

Either way the behavior on Afro is odd.
Did you reproduce this freezing behavior on that phone on our QuickStart example?: GitHub - Banuba/quickstart-android: Quick start examples for Banuba Face AR SDK on Android