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


#1

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?


#2

Hi Vasily,

Use the FrameDetector class for this scenario.
http://affectiva.github.io/developerportal/pages/platforms/v3_2/android/javadoc/index.html

Andy


#3

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 ?


#4

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.


#5

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?


#6

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