'Kinesis Live Stream Displayed in Android App Consumer

as context I have been developing my own surveillance system using AWS. Past the implementation of some requirements for my project using services like S3 and Cognito, I'm now facing a problem when implementing live video streaming using kinesis in my android app. I am able to stream from a Raspberry Pi with the command:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! x264enc  bframes=0 key-int-max=45 bitrate=500 tune=zerolatency ! video/x-h264,stream-format=avc,alignment=au ! kvssink stream-name=STREAM_NAME storage-size=128 access-key="ACCESS_KEY" secret-key="SECRET_KEY"

This does create a Kinesis stream and I can view it on AWS Website which is awesome. The problem is that I have not been able to implement the code to get the stream (through arn or stream name) and after that display it on my android app. I have seen tons and tons of documentation and got a hold of some of the processes that are behind different implementations (like using GStreamer with java + C code). I would post my code to get feedback but I'm completely lost when it comes to that and at the moment got none, so I was wondering if anyone has a good step-by-step guide regarding the code to get this kinesis stream and display it. I have seen that we can get kinesis stream data with GetMedia in AWS documentation yet I couldn't understand it or find the complete code for it (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_GetMedia.html). I have also tried downloading repositories from git but they don't work as well (usually the error is: Could not create Kinesis Video Client, even though I went to the code and checked that the credentials and region were good (https://github.com/awslabs/aws-sdk-android-samples/tree/main/AmazonKinesisVideoDemoApp)).

In short i need help with the coding aspect of the problem in order to consume a stream, where I get a kinesis stream (needs to be the type of stream that allows me to later analyze it and use AWS to implement facial recognition) and preferably in Java only, and to display it which I think isn't the hardest part. Thanks for listening.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source