# Getting the Status Bar Info



## adocilesloth (Jan 8, 2014)

Is there a way to get the stream time, dropped frames, current fps and bit rate and pass them to a plugin?
The OBS API doesn't appear (although I may well be wrong) to have any way of doing this and I can't get the information using a SendMessage.


----------



## Jim (Jan 8, 2014)

There is no way to query that information via plugin in the current version of OBS, no


----------



## adocilesloth (Feb 13, 2014)

I went poking around in the OBS files and came up with the following for getting out the status bar info:


```
API.cpp
under class OBSAPIInterface : public APIInterface
under public:

virtual UINT GetCaptureFPS() const		{return App->captureFPS;}
virtual UINT GetbytesPerSec() const		{return App->bytesPerSec;}
virtual UINT GetTotalFrames() const		{return App->network->NumTotalVideoFrames();}
virtual UINT GetFramesDropped() const	{return App->curFramesDropped;}
virtual UINT GetTotalStreamTime() const 	{return App->totalStreamTime;}

APIDefs.cpp

UINT OBSGetCaptureFPS()			{return API->GetCaptureFPS();}
UINT OBSGetbytesPerSec()			{return API->GetbytesPerSec();}
UINT OBSGetTotalFrames()			{return API->GetTotalFrames();}
UINT OBSGetFramesDropped()		{return API->GetFramesDropped();}
UINT OBSGetTotalStreamTime()		{return API->GetTotalStreamTime();}

APIInterface.h
under public:

virtual UINT GetCaptureFPS() const=0;
virtual UINT GetbytesPerSec() const=0;
virtual UINT GetTotalFrames() const=0;
virtual UINT GetFramesDropped() const=0;
virtual UINT GetTotalStreamTime() const=0;

under //C-style API exports

BASE_EXPORT UINT OBSGetCaptureFPS()
BASE_EXPORT UINT OBSGetbytesPerSec();
BASE_EXPORT UINT OBSGetTotalFrames();
BASE_EXPORT UINT OBSGetFramesDropped();
BASE_EXPORT UINT OBSGetTotalStreamTime();
```

I would be appreciative if these were considered for inclusion. If they don't make it, that's ok. I suspect this probably isn't the bast way of requesting this but I'm not sure how else to go about it.


----------



## Krazy (Feb 13, 2014)

Adding new features/capability for the current codebase of OBS probably won't happen.  Something like this will almost certainly be available after the rewrite is completed.


----------



## dodgepong (Feb 14, 2014)

You can always issue a pull request!


----------



## adocilesloth (Feb 14, 2014)

I knew there would be a better way :)
Thanks!


----------



## trophyking (Dec 21, 2017)

Is there a better way now ? A fresher focus here too  :)


----------



## dodgepong (Dec 21, 2017)

This thread is nearly 4 years old, so this is a hyper necro, but yes, all these things are available in OBS Studio's API. What do you need to do?


----------



## trophyking (Dec 21, 2017)

dodgepong said:


> This thread is nearly 4 years old, so this is a hyper necro, but yes, all these things are available in OBS Studio's API. What do you need to do?



So sorry for activate this thread , I just want to get the stream time, dropped frames, current fps and bit rate and pass them to a monitor DB or log file. 

Thank you for supply this information, i will check the OBS Studio's API.


----------



## dodgepong (Dec 21, 2017)

For an example of how to use the OBS Studio API to get that kind of information, check out the way that the obs-websocket plugin returns that information: https://github.com/Palakis/obs-websocket/blob/master/src/WSEvents.cpp#L608


----------



## trophyking (Dec 22, 2017)

dodgepong said:


> For an example of how to use the OBS Studio API to get that kind of information, check out the way that the obs-websocket plugin returns that information: https://github.com/Palakis/obs-websocket/blob/master/src/WSEvents.cpp#L608



That's very kind of you. 
I think this answer will make the session sleep quietly ，though it's at the first of google 'obs status bar' .


----------

