Bug: `GetStreamStatus`: `outputDuration` is higher than expected with Enhanced Broadcasting enabled
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
Other
OBS Studio Version (Other)
30.2.0-beta4
obs-websocket Version
5.1.0
OBS Studio Log URL
https://obsproject.com/logs/iy9DaINiISXI44EM
OBS Studio Crash Log URL
No response
Expected Behavior
When Enhanced Broadcasting enabled, outputDuration field in GetStreamStatus output request must represent the current duration in milliseconds for the output.
Current Behavior
The current duration in milliseconds for the output is multiplied by the number of video tracks set by Enhanced Broadcasting. The actual multiplication factor is unknown when "Maximum Video Tracks" option is set to Auto.
Steps to Reproduce
- Enable "Enable Enhanced Broadcasting" option in "Stream" tab
- Start streaming
- Observe the
GetStreamStatusoutput request
Anything else we should know?
No response
Reproduced on Windows 10, OBS 30.2.2.
obs-websocket calculated the stream duration by multiplying the amount of produced frames to the frame time (see https://github.com/obsproject/obs-websocket/blob/master/src/utils/Obs_NumberHelper.cpp#L26).
When using the Enhanced Broadcasting feature, it calculates that amount for ALL the streams. By default, there are 5 streams in total, 2 of which run at 60.03 FPS, and 3 of which run at 30.02 FPS (on average). Given that 60.03 FPS gives us 1 second of runtime on our scale, 30.02 FPS gives us 0.5000832917 seconds of runtime on our scale. So, 1 + 1 + 0.5000832917 + 0.5000832917 + 0.5000832917 = 3.5002498751 seconds. So, the difference is around 3.5 seconds per each second of the stream. It heavily depends on the frame time, so that's not the constant.