aws-samples / aws-panorama-samples

This repository has samples that demonstrate various aspects of AWS Panorama device and the Panorama SDK
https://docs.aws.amazon.com/panorama/
MIT No Attribution
82 stars 58 forks source link

Init commit, support Amazon Kinesis Video Streams from AWS Panorama A… #66

Closed aws-tec closed 2 years ago

aws-tec commented 2 years ago

…pplication.

Issue #, if available: Currently only one of Panorama samples(mot_analysis) has a kvs support with IAM role and supports single camera. It's more secure that we use AWS IoT to grant kvs access right and could support multiple cameras. Description of changes: Add a Panorama application sample: kinesis_video_streams. It provides a journey to allow user to fully understand how to work with Amazon KVS and AWS IoT. User can easily to request live/historic playback through Amazon KVS console or through Amazon KVS APIs to request DASH/HSL url.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

mrtj commented 2 years ago

Hello @aws-tec may I suggest you to check out also KVSSkyLine module of the panorama-backpack library, that also implements Panorama -> KVS video streaming?

aws-tec commented 2 years ago

Hi @mrtj , yes KVSSkyLine module implements Panorama streaming out to KVS. Also it supports multiple camera but it might hit the IAM limitation or security issue. Says that if you give a IAM role with multiple cameras access, it would allow all KVS cameras access using the same token. If you give an independent IAM role for each camera, it would eventually hit the maximum number of IAM role limitation(5000). Therefore, we grant KVS access via AWS IoT Credential provider to give the separated access with one IAM role in this sample application.

mrtj commented 2 years ago

This is very interesting, do you have to create an additional IoT thing for your application, or you can use directly the one that Panorama backend services create for your device? In the past I had some experience of configuring IoT credentials to work with KVS, but I ruled out this method in KVSSkyLine because it required additional configuration and creating +1 IoT thing that seemed to me too demanding for users.

Disclaimer: I'm the author of panorama-backpack :)

aws-tec commented 2 years ago

@mrtj , Yes. In my notebook, the journey shows how to create AWS IoT Things, credentials, policies and how we grant the KVS access via STS assume role. It's more secure we if we use IoT-based to access KVS service. If the devices were compromised, the impact could be minimized.

jk1333 commented 2 years ago

Thank you for good sample to minimize redundant! I got some good ideas from your sample. My one point is image aligning. The appliance does not guarantee image sequences. So should use timestamp to let gstreamer aligning it. Timestamp can be obtained by following code ts = stream.time_stamp[0] + stream.time_stamp[1] * 0.000001

shimomut commented 2 years ago

Thank you for your contribution > @aws-tec , Reviewed this PR and provided my feedback using different chat channel to discuss.

mrtj commented 2 years ago

Hello @shimomut, would you mind involving also me in the discussion of KVS on Panorama? I authored a library that does KVS streaming from the Panorama app and would like to merge our efforts on providing this functionality. Thank you!

shimomut commented 2 years ago

@mrtj, for more detailed discussion, can we start a chat over email or somewhere else (e.g. Twitter direct messages)? Please send your contact information to me ( email to shimomut {atmark} amazon.com, or DM to https://twitter.com/smmrtmnr ), thank you!