awslabs / amazon-kinesis-video-streams-pic

Apache License 2.0
49 stars 51 forks source link

Fix frame rate calc #124

Closed disa6302 closed 3 years ago

disa6302 commented 3 years ago

Issue #, if available: https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/issues/562 Description of changes: Previously, the frame rate reported used getTime() for calculation. The current frame rate truly is indicative of the observed frame rate, which means, it can give an idea of whether the encoder is stable or bursty, however, it is not truly indicative of the elementary frame rate which requires using PTS. This led to adding a new metric called elementaryFrameRate that indicates the original streams frame rate and not the rate at which the frames are produced.

The PR also addresses very high FPS values being observed in multitrack scenario. We only calculate frameRate for video track.

API level unit test is added for Client and Stream metrics.

TODO: Functional unit tests for metrics are missing. This is a bigger work item. We must simulate streaming in the tests and extract metrics to ensure values are appropriately calculated/reported.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.