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

kinesis video stream Codec changed error in media playback.

0

i am using kinesis video stream producer to sending h264 stream to kinesis video stream i am able to see my video in media playback window. when resolution of my video changes i am getting error "Codec changed.", if i reload the web page it starts working again with new resolution. suggest some steps to resolve this issue.

asked a month ago46 views
1 Answer
0

The issue you're experiencing with the "Codec changed" error when the resolution of your video changes in Kinesis Video Streams is related to how the service handles codec private data (CPD) changes. Here are some steps to help resolve this issue:

  1. Ensure consistency in your stream: Kinesis Video Streams requires that tracks remain consistent throughout the queried media. When you change the resolution, it's likely causing a change in the codec private data, which can lead to playback issues.

  2. Handle CPD changes properly: If you need to change the resolution, make sure you're handling the codec private data changes correctly in your producer. You may need to update your producer code to properly signal these changes.

  3. Use appropriate API: Different Kinesis Video Streams APIs handle CPD changes differently. For example, the GetHLSStreamingSessionURL API supports CPD changes during a streaming session, while GetClip and GetDASHStreamingSessionURL do not. Consider using the API that best fits your use case.

  4. Limit CPD changes: If you're using the DASH streaming format, note that only 500 CPD changes are allowed per streaming session. Try to minimize the number of resolution changes if possible.

  5. Verify frame data: Ensure that the resolution of the frames matches the resolution specified in the Codec Private Data. Also, verify that the H.264 profile and level of the encoded frames match the profile and level specified in the Codec Private Data.

  6. Check timestamps: Ensure that the timestamps are accurate, in the correct order, and that no duplicate timestamps are being created.

  7. Consider implementing a more robust client-side solution: Since reloading the web page resolves the issue, you might want to implement an automatic reload or reinitialize the player when a codec change is detected on the client side.

By implementing these steps, you should be able to handle resolution changes more smoothly in your Kinesis Video Streams application. If the issue persists, you may need to review your producer code to ensure it's correctly handling resolution changes and updating the codec private data accordingly.
Sources
Troubleshooting Kinesis Video Streams - Amazon Kinesis Video Streams
Video playback track requirements - Amazon Kinesis Video Streams

profile picture
answered a month ago
  • if i click fast forward it works fine with new resolution. if i reload it works fine with new resolution. suggest API to properly send resolution change info to media playback.

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