obsproject / obs-websocket

Remote-control of OBS Studio through WebSocket
GNU General Public License v2.0
3.84k stars 704 forks source link

Feature Request: Add Bitrate back to GetStats #1080

Closed zusorio closed 1 year ago

zusorio commented 1 year ago

Feature Request Type

RPC Request

Feature Request Type (Other)

No response

Requested Feature

Add the current Bitrate to the response of GetStats

Requested Feature Usage Scenario

Tracking stats while experiencing unreliable networking conditions. I used the StreamStatus event for this with v4 which had the bitrate.

SanshooSenshi commented 1 year ago

+1

JoqniX commented 1 year ago

+1

tt2468 commented 1 year ago

Stream bitrate can be inferred via the outputBytes field of GetStreamStatus

JoqniX commented 1 year ago

Stream bitrate can be inferred via the outputBytes field of GetStreamStatus

yea i've been using outputBytes from GetStreamStatus but is there a way to get the value same as it is in obs? (for example if its 6,000bitrate then it would show up as "6000" rather than showing it as "6047573147" i did some digging and it seems some do it as x8 , /1000 the value from outputBytes? should i be using this way? if there's any other methods you would recommend do let me know!

tt2468 commented 1 year ago

OBS displays bitrate in bits, outputBytes is the total data sent by the output. There are 8 bits in a byte, and the byte rate is determined by change in outputBytes over a known period of time.

If you call GetStreamStatus, then call it again exactly one second later, you subtract the two to get bytes per second. Multiply that by 8 and you have bits per second.