How to get the bottom bar stats in obs python?

ITR

New Member
How do I get the stats in the bottom bar when using OBS python? Mostly interested in stream duration, but rest would be nice to have too.
UwnjoUq.png
 
For stream or recording duration, one option is to use obs_frontend_add_event_callback to specify a callback, and handle OBS_FRONTEND_EVENT_STREAMING_STARTED/STOPPED events. Save a timestamp; current duration = now - time_of_start

For the stats etc.you might look at https://obsproject.com/forum/resources/obs-stats-on-stream.1319/ I haven't used it, and it's in Lua rather than Python, but it should at least point you at the OBS functions to look at
 

ITR

New Member
Ah, thanks! By looking at it I found out theres an Output API, that didn't show up because I was searching for seconds specifically.
 
Top