What is the best way to get emotions at video chat?


Hi, I would like try Affectiva SDK in Video chat app from here https://github.com/opentok/opentok-android-sdk-samples.
How to define emotions of the person on the other end of the phone?
Camera stream seems to be useless in this situation, as the picture is taken by camera of other phone.
Maybe, video frame stream detector?


Hi Vasily,

Use the FrameDetector class for this scenario.



Thank you,
should I use AsyncFrameDetector like in this example https://github.com/Affectiva/android-sdk-samples/tree/master/FrameDetectorDemo/src/main/java/com/affectiva/framedetectordemo ?


Sure, feel free to use that sample code as a useful reference implementation, keeping in mind that it’s not the only way to do things. I suggest reviewing that code in detail to determine if it’s a good fit for what you want to do.


Dear Andy,
could you please kindly advice me then how to create the frame from SurfaceView? As I understood from your link, Affdex Frame can be created from Bitmap, but getting Bitmap from SurfaceView is not a simple task (for ex., https://stackoverflow.com/questions/49004384/get-bitmap-from-surfaceview?noredirect=1&lq=1 )
Probably, you know the effective way?


The technique I’ve used is to leverage the Camera.onPreviewFrame callback. But there are some tips here that may be useful: