amazon-kinesis-video-streams-producer-sdk-cpp
amazon-kinesis-video-streams-producer-sdk-cpp copied to clipboard
[FEATURE] Support putFragmentMetadata from kvssink
Issue #, if available: https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/discussions/1031
What was changed?
Modify kvssink and sample application to support adding metadata per fragment
Why was it changed?
This feature was missing from kvssink and was requested by multiple customers
How was it changed?
- This feature allows adding multiple metadata tags to fragments until a limit (10 metadata per fragment) is reached. To repeatedly put the metadata while streaming, a timer has been used which triggers a function
put-metadataevery 2 seconds. This application-level logic can be customized by the customers to be fired on their own set of events / frequency.put-metadatacan be modified by the customers to generate metadata tags to be put. Currently, they consume values from a global instance of CustomData whose counter is updated withinput-metadataitself.put-metadataalso callsput-fragment-metadata, an inline function fromgstkvssink.h. The reason for the same is to abstract the details of triggering the event from the customer. put-fragment-metadatagenerates theGstStructureexpected by theGST_EVENT_CUSTOM_DOWNSTREAMand ultimately triggers theGST_EVENT_CUSTOM_DOWNSTREAMthat handles the tags and calls the underlying KVS APIputFragmentMetadata.- When this event is triggered, it checks whether the structure is in the expected format / the
fragment_metadata_counthas reached the max or not. If it has, it warns the customer about it through the logs without disrupting the streaming.
What testing was done for the changes? Tested the following locally:
- Tested that the metadata was persisted in the video by checking the video dump with
mkvinfo - Tested that the metadata marked as
persistentis indeed persisted for each fragment of the video - Tested that the metadata marked as
non-persistentis not persisted for each fragment of the video - Tested that the metadata that is to be put, toggles between
persistentandnon-persistentand the both of them are marked correctly in the video - Tested that the streaming continues despite failures in the putFragmentMetadata
- Tested that the count for the persistent metadata and the current fragment's metadata is maintained correctly and any new incoming metadata is ignored and the API call is skipped after receiving an error from the API
putFragmentMetadata mkvinfoon a video dump from the tests (even metadata-keys are persistent, odd ones are non-persistent): mkvinfo-metadata.txt
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Codecov Report
Attention: Patch coverage is 0% with 58 lines in your changes are missing coverage. Please review.
Project coverage is 16.27%. Comparing base (
eeb392f) to head (db6d18f). Report is 9 commits behind head on develop.
:exclamation: Current head db6d18f differs from pull request most recent head 47d702d. Consider uploading reports for the commit 47d702d to get more accurate results
| Files | Patch % | Lines |
|---|---|---|
| samples/kvssink_gstreamer_sample.cpp | 0.00% | 50 Missing :warning: |
| src/gstreamer/gstkvssink.cpp | 0.00% | 8 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #1122 +/- ##
===========================================
- Coverage 16.48% 16.27% -0.22%
===========================================
Files 50 50
Lines 7019 7092 +73
===========================================
- Hits 1157 1154 -3
- Misses 5862 5938 +76
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.