Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Add graphs for Stats dock #9190

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

pkviet
Copy link
Member

@pkviet pkviet commented Jul 1, 2023

Description

This adds in the Stats dock a graph plotting bitrate over time as well as dropped frames.
This allows better monitoring of network issues.

Dynamic bitrate was triggered in the next screenshot, and after the congestion ended, one can see clearly the bitrate increasing.

In the next screenshot, one can see dropped frames (when dynamic bitrate is disabled).

The graph can be zoomed in and zoomed out with the mouse.
There's a tooltip explaining it.

The time span for the horizontal time axis can be adjusted.

NOTE: the last commit should be dropped eventually. Since the PR requires QCharts, that commit pulls binaries from a a companion obs-deps PR [1] generated from CI in my obs-deps fork.
[1] obsproject/obs-deps#192

Motivation and Context

Allow better monitoring of the stream.
On default the graph displays the last minute of data but this can be expanded to 4 hrs. This allows an analysis of network conditions on both short medium and long time scales.

How Has This Been Tested?

See screenshots.
I simulated network issues using 'clumsy', allowing to test both dynamic bitrate & frame dropping.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@gxalpha gxalpha added the UI/UX Anything to do with changes or additions to UI/UX elements. label Jul 1, 2023
@alinsavix
Copy link
Contributor

This is pretty cool, and probably damned useful.

It would be great, I think, if we also had a graph for render & encoder overload. I've definitely run into cases where it'd be really useful to see when overload happened, rather than just noticing at the very end of a stream and going "wonder when that happened, and if it was all at once or gradually"...

@WizardCM WizardCM added the New Feature New feature or plugin label Jul 1, 2023
@pkviet pkviet force-pushed the statsgraphs branch 4 times, most recently from c4faa1e to 54d82f4 Compare July 2, 2023 17:23
@pkviet pkviet added the Seeking Testers Build artifacts on CI label Jul 3, 2023
@pkviet
Copy link
Member Author

pkviet commented Jul 3, 2023

Update
Added a show / hide button.

obs64_2023-07-03_10-09-52

I plan to move the graphs to a separate tab in the Stats dock.

@alinsavix 👋 hi it's been a while !
i can add the frames missed due to rendering lag / skipped frames due to encoding lag.
But I need to check what would be the useful format:

  • percentage,
  • raw number,
  • raw number per second
    This impacts whether all the data can be displayed in the same graph.
    I'll probably go with the last format.

@alinsavix
Copy link
Contributor

alinsavix commented Jul 3, 2023

@alinsavix 👋 hi it's been a while!

I do indeed still exist! More or less. Slightly. (also, hi!)

I need to check what would be the useful format:

  • percentage,
  • raw number,
  • raw number per second
    This impacts whether all the data can be displayed in the same graph.
    I'll probably go with the last format.

Definitely the last format, because that makes it super easy to see if something is happening and when it's happening. A percentage graph might could work; just having the raw number is probably the worst of the choices since once you get more than a few hundred of something, it might be hard to tell if the graph is rising or not at any particular moment (since the scale of the change for "add 1 to 5000 existing drops" is near nothing. Raw count per second makes it easy to see at a glance when there was a problem (because the graph makes a spike at the moment it happens, and then returns to zero if there are no more problems, or stays level if the problem continues but doesn't get better/worse), and makes it really easy to tell at a glance what the scale of the problem is.

One thing that might be worth thinking about is how to summarize the data when there are more datapoints on the X axis than there are pixels -- e.g. if you're showing rate-per-second, and showing an hour of data, you'd need 3600 horizontal pixels to show one pixel per second, which is... not reasonable. So do you summarize it by picking the worst value per second in a given time range? The average value? Total value? Most graphing libraries will do that kind of summarization for you, but you still have to tell them what kind to do. I don't have a specific suggestion here, but it might be worth at least a couple of seconds of thought. (or make it selectable, but that might be a bit... excessive, for this use)

@pkviet
Copy link
Member Author

pkviet commented Jul 4, 2023

Ok i'll go with raw per sec.
As to the case of large number of datapoints higher than the pixel number, there's no way in qt to customize that. Qtcharts makes its own sauce to adjust what's displayed.

@alinsavix
Copy link
Contributor

Qtcharts makes its own sauce to adjust what's displayed.

This is a slight surprising, but I guess the reality is that most people probably wouldn't understand the choices when making it configurable, even if it was. Which is frustrating, given just how badly a graph can hide important things when it's not done properly. Ah well, I'll still totally take it!

Basic.Stats.Bitrate.kbps="Bitrate (kbps)"
Basic.Stats.Graphs="Live Graphs (Bitrate & Dropped Frames)"
Basic.Stats.Graph.Tooltip="zoom out: right-click.\n zoom in: select a vertical span."
Basic.Stats.Graphs.Show.Hide="Show / Hide Graphs."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Basic.Stats.Graphs.Show.Hide="Show / Hide Graphs."
Basic.Stats.Graphs.Show.Hide="Toggle Graphs"

@derrod
Copy link
Member

derrod commented Jul 8, 2023

Perhaps rather than hiding/unhiding the graphs they could just be a separate dock entirely?

@pkviet
Copy link
Member Author

pkviet commented Jul 9, 2023

Perhaps rather than hiding/unhiding the graphs they could just be a separate dock entirely?

I can certainly do that.
I'm waiting for more instructions from @Warchamp7 and @GeorgesStavracas and ui/ix discussions. Mockups are planned by George.
Warchamp suggested tabs. Also he wanted output specific stats (ex SRT) in these tabs. And the possibility to expand to other outputs (whip? MoQ? Rist ?)
I'm planning to implement these suggestions.

@pkviet pkviet force-pushed the statsgraphs branch 4 times, most recently from b769a2b to 9dd67d4 Compare December 24, 2023 21:51
This splits the ffmpeg mpegts muxer output from obs-ffmpeg project.
There's some common code between obs-ffmpeg-output.c &
obs-ffmpeg-mpegts.c.
But most of it had already been factored out to allow for easier
maintainance and readability.
The goal is to allow simpler maintainance of the mpegts output.

Signed-off-by: pkv <pkv@obsproject.com>
This adds a proc handler for statistics for SRT protocol.

Signed-off-by: pkv <pkv@obsproject.com>
This copies QtCharts.dll as well as QtOpenGL.dll & QtOpenGLWidgets.dll
on which it depends.

Signed-off-by: pkv <pkv@obsproject.com>
This adds a new SRT Stats dock with several important statistics for the
SRT protocol (RTT, retransmitted packets, dropped packets) in a chart
which is updated live.

Signed-off-by: pkv <pkv@obsproject.com>
This is to ensure test builds are working.
This commit should be removed on merging of the PR.

Signed-off-by: pkv <pkv@obsproject.com>
This plots the bitrate over time and dropped frames.
The time span is selectable.

Signed-off-by: pkv <pkv@obsproject.com>
This adds QtCharts in CI for the linux script installing deps.

Signed-off-by: pkv <pkv@obsproject.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature or plugin Seeking Testers Build artifacts on CI UI/UX Anything to do with changes or additions to UI/UX elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants