AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://airensoft.com/ome.html
GNU Affero General Public License v3.0
2.59k stars 1.06k forks source link

Inaccurate keyframe interval, fps metrics when querying stream info over API #1445

Closed hernanrz closed 6 months ago

hernanrz commented 1 year ago

Describe the bug When querying a stream info (api endpoint: v1/vhosts/default/apps/live/streams/<stream>), the server reports strange values for keyframe interval and fps (fractional values)

image while querying the same stream but in the origin server returns correct FPS values, although the keyframe value reported is definitely different from the one set in OBS

image

OME origin/edge Config https://gist.github.com/hernanrz/87fb0ff693cbd91ff50c3f6be1436a58

Version: OvenMediaEngine v0.16.0 ((From archive)) running with docker image airensoft/ovenmediaengine@sha256:167de56e8b6600e0f459038780fff17659d7f835a3464834c20403b1e694564e

getroot commented 1 year ago

This is the difference between the config value and the measured value. In the API, the origin responds with setting values, and the edge responds with actual measured values. To eliminate this confusion, I will output config values and measured values separately in the API response.

hernanrz commented 1 year ago

That sounds like a reasonable solution, thank you 👍

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

getroot commented 6 months ago

@hernanrz

I added the following information to the GET Stream API: It has been committed to the master branch and will be available from the next release.

bitrate_conf bitrate_measured framerate_conf framerate_measured keyFrameInterval_conf keyFrameInterval_measured

Sorry I'm so late!

getroot commented 6 months ago

I updated this to this:

bitrateLatest is the value measured in the most recent second. framerateLatest is the value measured in the most recent second. keyFrameIntervalLatest is the number of delta frames between the immediately previous keyframe and the keyframe before it.

~Avg is the overall average.

deltaFramesSinceLastKeyFrameis the number of delta frames counted from the last keyframe.

"bitrate": "1000000",
"bitrateAvg": "1015679",
"bitrateConf": "1000000",
"bitrateLatest": "1094189",

"framerate": 30.0,
"framerateAvg": 30.022541046142578,
"framerateConf": 30.0,
"framerateLatest": 29.721956253051758,

"keyFrameInterval": 28,
"keyFrameIntervalAvg": 28.619047164916992,
"keyFrameIntervalConf": 0.0,
"keyFrameIntervalLatest": 30,
"deltaFramesSinceLastKeyFrame": 25,
naanlizard commented 6 months ago

I was going to suggest not changing the old names, this is a good update thank you!

getroot commented 6 months ago

@bchah I thought you said you needed this too, right?

bchah commented 6 months ago

@getroot yes, thank you! I saw the commits and am excited to incorporate this in the next release. It gives users a way to see their "current" frame and bit rates. Great work and thank you very much :)