amazon-kinesis-video-streams-producer-c icon indicating copy to clipboard operation
amazon-kinesis-video-streams-producer-c copied to clipboard

[QUESTION] Missing fragments in get_images api

Open david-molnar-oculai opened this issue 2 years ago • 5 comments

We're using this producer library to send frames to AWS Kinesis Video. The stream's resolution is 2560x1920 and has 1 FPS with 1 Mbps max bitrate. The stream plays perfectly fine when using HLS streaming. No frames are missing. Also, requesting MP4 fragments for a specific time range works correctly. However, using the get_images from kinesis-video-archived-media fails with NO_MEDIA errors. Roughly 50% of the frames is missing. What could be the reasons for this? What should we check?

We set the frame.decodingTs and frame.presentationTs to the same value. Here is a list of the values for a 16 second clip:

1692794842005
1692794843005
1692794844005
1692794845005
1692794846005
1692794847005
1692794848005
1692794849005
1692794850005
1692794851005
1692794852005
1692794853005
1692794854005
1692794855005
1692794856005
1692794857005

david-molnar-oculai avatar Aug 23 '23 12:08 david-molnar-oculai

@david-molnar-oculai ,

Are you using the sample application? If not, are you enabling image generation in the SDK using this API? https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/v1.4.1/samples/KvsAudioVideoStreamingSample.c#L79

disa6302 avatar Aug 25 '23 17:08 disa6302

@disa6302 thank you for your reply. Yes, we used the sample application as a base (modified it slightly). I tried to call putKinesisVideoEventMetadata after every keyframe (every 16 frame = every 16 seconds), but it didn't make a big difference. Calling it more often, e.g. every 4 frame failed with 0x5200008b error code (this error code is missing from https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-sdk-errors.html). The missing fragment rate is around 45% now. What should the expected output to be? Should we expect an image every 16 seconds, if the sampling interval is 1 second?

david-molnar-oculai avatar Aug 31 '23 10:08 david-molnar-oculai

Producing a key frame every 4 frame (instead of every 16 frame) and calling putKinesisVideoEventMetadata fixes the problem.

david-molnar-oculai avatar Sep 04 '23 13:09 david-molnar-oculai

Also probably worth noting that GET_IMAGES usually doesn't return an image for the first result

daveisfera avatar Sep 08 '23 19:09 daveisfera

It's fine, that not all images are returned. We have other sources, where the failure rate is around 15%, which is acceptable, but in our case it's 50%.

david-molnar-oculai avatar Sep 11 '23 07:09 david-molnar-oculai