aws / amazon-chime-sdk-android

An Android client library for integrating multi-party communications powered by the Amazon Chime service.
https://aws.amazon.com/chime/chime-sdk/
Apache License 2.0
105 stars 49 forks source link

Add picture capture to the ongoing camera capture stream #536

Closed andreav closed 1 year ago

andreav commented 1 year ago

Hello, I need to capture images from the streaming camera (in order to randomly analyze them).

I have succesfully implemented this aws demo and I can setup a meeting between two android phones.

I found this aws readme that seems to accomplish my needs (inside onVideoFrameReceived, Im'm supposing to send any frames to the analyzer)

However I do not understand how/where to register the MyVideoProcessor class, i.e. where to integarte the line cameraCaptureSource.addVideoSink(myVideoProcessor) and how to obtain the cameraCaptureSource

Any help would be appreciated. Thank you

linsang21 commented 1 year ago

Hi @andreav, thanks for reaching out.

If you want to use our default implementation of camera capture source, you could simply declare an instance, register your own video processor class, and set it as the external source for starting local video.

Example would be like in the demo app:

val cameraCaptureSource = DefaultCameraCaptureSource(
                applicationContext,
                logger,
                surfaceTextureCaptureSourceFactory
)

cameraCaptureSource.addVideoSink(myVideoProcessor)

meetingSession.audioVideo.audioVideo.startLocalVideo(cameraCaptureSource)
cameraCaptureSource.start()
andreav commented 1 year ago

Thank you. by following your suggestions it is now working.