By using AWS re:Post, you agree to the AWS re:Post Terms of Use

kinesis video stream media playback UI not stopping.

0

I am sending video using kinesis video stream producer sdk cpp, when i call KinesisVideostream->stop(), KinesisVideoProducer->freeStream(KinesisVideostream) and exits the application, still kinesis video stream media playback keeps waiting for incoming fragments. how can i notify to UI that producer is stop.

asked 18 days ago14 views
1 Answer
0

When you're experiencing issues with the Kinesis Video Stream media playback UI not stopping after calling stop() and freeStream() methods, it's important to understand how the playback system works and what might be causing this behavior.

The issue you're describing could be related to how the Kinesis Video Streams service handles stream termination and how the playback UI interprets this information. When you stop the producer and free the stream, it doesn't immediately signal the end of the stream to the playback UI. The UI continues to wait for incoming fragments because it doesn't receive an explicit notification that the producer has stopped.

To address this issue, you can try the following approaches:

  1. Use stopSync() instead of stop(): Before calling freeStream(), try using the stopSync() method. This method sends remaining bytes in the buffer and waits for an acknowledgment, which might help signal the end of the stream more effectively.

  2. Implement a custom signaling mechanism: You could add a custom metadata or a special frame at the end of your stream to indicate that the producer has stopped. The playback UI would need to be modified to recognize this signal and stop waiting for new fragments.

  3. Set appropriate timeouts: Configure your playback UI to stop waiting for new fragments after a certain period of inactivity. This would require adjusting the playback implementation to include timeout logic.

  4. Use GetMedia API for lower latency: If your application requires very low latency, consider using the GetMedia API instead of HLS playback. This might provide more immediate feedback when the stream stops.

  5. Check fragment duration: Ensure that your fragment duration is set appropriately. Very short fragments (less than 500 milliseconds) might cause issues with playback and stream termination.

Remember that the behavior you're experiencing is partly due to how Kinesis Video Streams handles stream termination and how the playback UI interprets the stream state. Implementing one or more of these suggestions should help you achieve the desired behavior of notifying the UI when the producer stops.

Sources
Write and examine the code - Amazon Kinesis Video Streams
Video playback with HLS - Amazon Kinesis Video Streams
PutMedia - Amazon Kinesis Video Streams

profile picture
answered 18 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions