aws/amazon-kinesis-video-streams-parser-library

How to poll streams every 10 seconds

Closed this issue · 7 comments

Hi,

I'm currently using kinesisvideoExample module, by using i can able to save mkv files. I want to save this mkvfile with respective 10 seconds interval in a single file. Say example i started parser with particualar PRODUCER_TIME_STAMP as startselector, i want skip from on that time 10:00, 10:10,10:20... => a.mkv kind of. Kindly help me out to resolve this issue, it would be verymuch helpful.

Not sure I understand the scenario. Perhaps, if you need the fragments then you could use https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_ListFragments.html which will give you the inclusive list of fragments for a particular period?

Hi @MushMal, Thanks for the response. i want to save mkv file not in sequence manner, i want to skip frame inbetween with 10 seconds interval based. can i modify in any one of the module to achieve this?

@varun-tangoit there is some confusion I think. KVS backend operates on a Fragment granularity and not a Frame. In order to retrieve a particular frame you will need to retrieve the fragment and parse/unpack it. If you need to retrieve a set of already persisted fragments (ts = present ts - retention period, where retention != 0) you could use the ListFragments API as I mentioned earlier and then do GetMediaForFragment https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_GetMediaForFragmentList.html. However, if you are attempting to consume realtime stream you will need to use GetMedia API. In this case, check out the documentation of GetMedia https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_GetMedia.html - you could specify your application specific start selector, consume only 10 seconds and drop the connection. Repeat at a later time.

Tahnks @MushMal. Yeah i currently using Getmedia API call only and Can i consume without drop connection with 10 seconds of interval?

Unfortunately not with the realtime GetMedia.

okay @MushMal . thanks again!

Resolving. Please feel free to cut a new issue if you need anything