Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming webcam video to AWS Kinesis?

I know this might be a relatively generic question, but I'm trying to see how I can get pointed in the right direction...

I'm trying to build a live face recognition app, using AWS Rekognition. I'm pretty comfortable with the API, and using static images uploaded to S3 to perform facial recognition. However, I'm trying to find out a way to stream live data into Rekognition. After reading the various articles and documentation that Amazon makes available, I found the process but can't seem to get over one hurdle.

According to the docs, I can use Kinesis to accomplish this. Seems pretty simple: create a Kinesis video stream, and process the stream through Rekognition. The producer produces the stream data into the Kinesis stream and I'm golden.

The problem I have is the producer. I found that AWS has a Java Producer library available (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-sdk-javaapi.html). Great... Seems simple enough, but now how do I use that producer to capture the stream from my webcam, and send off the bytes to Kinesis? The sample code that AWS provided actually uses static images from a directory, no code to get it integrated with an actual live source like a webcam.

Ideally, I can load my camera as an input source amd start streaming. But I can't seem to find any documentation on how to do this.

Any help, or direction would be greatly appreciated.

like image 627
nukalov Avatar asked Mar 06 '23 13:03

nukalov


1 Answers

You can use GStreamer sample app which uses webcam or any camera attached to your machine as input to ingest video into Kinesis Video Streams. Currently the sample application can be executed in Mac, Ubuntu or Raspberry Pi. Also you can use the Android sample app to ingest video from an Android device.

Also for the AWS Rekognition integration with Kinesis Video Streams, please checkout the sample published in the Consumer Parser library. This example shows how to ingest video file (which you can replace with real-time producer like GStreamer sample app above), retrieve data, parse MKV, decode H264 frames, integrate with Rekognition JSON output and draw bounding boxes on the face detected in video frame.

like image 152
Babu Prasad Avatar answered Mar 15 '23 20:03

Babu Prasad