Skip to content

Data Written to Kinesis Video Stream But No Media Playback on Kinesis Video Stream Console

0

Hi everyone,

I'm running a pipeline on GitHub Codespaces to stream video data to Kinesis Video Streams using the following gst-launch-1.0 command:

gst-launch-1.0 -v rtspsrc location="rtsp://rtspstream:d8de514b5050b33d5e8e193d52b212f1@zephyr.rtsp.stream/movie" short-header=TRUE ! rtph264depay ! h264parse ! kvssink stream-name="ip-camera-stream" storage-size=128

Observations:

  1. On the terminal, I can see logs indicating that data is being written to the Kinesis Video Stream:
2024-12-02 13:13:26 [124739053934336] DEBUG - fragmentAckReceivedHandler invoked
2024-12-02 13:13:26 [124739053934336] DEBUG - postReadCallback(): [ip-camera-stream] Wrote 65524 bytes to Kinesis Video. Upload stream handle: 19
2024-12-02 13:13:26 [124739053934336] DEBUG - postWriteCallback(): Curl post body write function for stream with handle: ip-camera-stream and upload handle: 19 returned: {"EventType":"BUFFERING","FragmentTimecode":1733144577985,"FragmentNumber":"91343852333181600767382685950288783325611840082"}
  1. In the Kinesis Video Streams console, the PutMedia metrics are not updating. However, the MPEG and HLS playback status seem to be showing updates. putmedia dashboard

  2. No media is being played in the Kinesis Video Streams player on the console. It displays:

No media found
Verify that you are streaming to ap-south-1 and the fragment timecodes are correct, or download the Kinesis Video Streams Producer SDK to set up your device.

What I've Tried:

  • Verified the RTSP source URL works with ffmpeg and is streaming correctly.
  • Ensured the region matches the endpoint: ap-south-1.
  • Increased the buffer and storage size in the pipeline.

Environment:

  • Running on GitHub Codespaces.
  • Using GStreamer for streaming.

Questions:

  • Could this be related to how timestamps or fragments are generated in the GStreamer pipeline? If so, how can I debug or fix this?
  • Is there an issue with running this on Codespaces that might affect Kinesis Video Streams integration?
  • Any suggestions on additional configurations or logs I should check to diagnose this issue?

Any help or pointers would be greatly appreciated!

1 Answer
0

Based on the information provided, it appears that you're encountering an issue where data is being written to your Kinesis Video Stream, but it's not displaying in the Kinesis Video Streams console player. This situation can occur due to several reasons, and I'll provide some insights and suggestions to help you troubleshoot the issue.

  1. Fragment Timecodes: The error message you're seeing in the console player suggests that there might be an issue with the fragment timecodes. Kinesis Video Streams relies on proper timecodes for playback. The GStreamer pipeline you're using might not be generating the correct timecodes or fragment metadata. To address this:

    • Ensure that your GStreamer pipeline is correctly setting the fragment metadata and timecodes.
    • You might need to add elements to your GStreamer pipeline to properly set timestamps, such as using a 'timeoverlay' element.
  2. Codec and Format Validation: Kinesis Video Streams doesn't parse and validate the codec private data during ingestion via the PutMedia API. However, it does extract and validate the necessary information from the codec private data for MPEG-TS and MP4 fragment packaging when consuming the stream via the HLS APIs. This means that while your data might be ingested, it could be in a format that's not compatible with the playback mechanism.

    • Verify that your H264 stream is properly formatted and contains all necessary metadata for playback.
    • Consider using the MPEG-TS format, which is known to work well with Kinesis Video Streams.
  3. Streaming Environment: Running on GitHub Codespaces shouldn't inherently cause issues with Kinesis Video Streams integration. However, ensure that:

    • Your Codespace has stable and sufficient network bandwidth to maintain the stream.
    • The necessary permissions and configurations are in place for your Codespace to interact with AWS services.
  4. Additional Debugging Steps:

    • Use the AWS CLI or SDK to retrieve stream info and check if fragments are being correctly stored.
    • Enable debug logging in your GStreamer pipeline to get more detailed information about the streaming process.
    • Check CloudWatch logs for any error messages or warnings related to your Kinesis Video Stream.
  5. Consider using the Kinesis Video Streams Producer SDK: As mentioned in the error message, using the official SDK might help ensure proper integration and metadata handling.

  6. Capacity Mode: If you're experiencing any throughput issues, consider using the on-demand capacity mode for your Kinesis Data Stream. This allows automatic scaling and can help if you're encountering any write throughput exceeded errors.

By addressing these points, particularly focusing on the fragment timecodes and format validation, you should be able to resolve the playback issues in the Kinesis Video Streams console. If the problem persists, you may need to examine your GStreamer pipeline in more detail or consider using alternative tools or SDKs provided by AWS for video streaming to Kinesis Video Streams.
Sources
Consume media data - Amazon Kinesis Video Streams
Amazon Kinesis Video Streams Features - Secure Video Ingestion for Analysis & Storage - Amazon Web Services
Optimize write throughput for Amazon Kinesis Data Streams | AWS Big Data Blog
PutMedia - Amazon Kinesis Video Streams

answered a year 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.