Question / Help Profiler results

zerocul

Member
Please, teach me how to read profiler results :) May be it will improve my help to other peoples in ru region :)
Log for example.
Code:
23:49:46: 
23:49:46: Profiler results:
23:49:46: 
23:49:46: ==============================================================
23:49:46: frame - [100%] [avg time: 1.353 ms] [avg calls per frame: 1] [children: 79.7%] [unaccounted: 20.3%]
23:49:46: | scene->Preprocess - [0.296%] [avg time: 0.004 ms] [avg calls per frame: 1]
23:49:46: | video encoding and uploading - [79.5%] [avg time: 1.075 ms] [avg calls per frame: 1] [children: 67.2%] [unaccounted: 12.3%]
23:49:46: | | CopyResource - [0.591%] [avg time: 0.008 ms] [avg calls per frame: 0]
23:49:46: | | conversion to 4:2:0 - [0.296%] [avg time: 0.004 ms] [avg calls per frame: 0]
23:49:46: | | call to encoder - [65%] [avg time: 0.88 ms] [avg calls per frame: 0]
23:49:46: | | sending stuff out - [1.26%] [avg time: 0.017 ms] [avg calls per frame: 0]
23:49:46: ==============================================================
23:49:46:
 

dodgepong

Administrator
Community Helper
The profiler tells you how long, on average, it takes OBS to process, encode, and send out one frame of data.

If you are running a stream at 30fps, then (1 second) / (30 frames) = 0.033 seconds, or 33ms. Thus, if you want smooth 30fps video, you need a better frame time than 33ms, or else you will get lagged frames. And even if your average is slightly below 33ms, you will probably still be lagging frames because some of those frames take above-average time to encode.

There are 2 main sub-sections (and this is a simplistic and not fully-accurate description, but it gets the message across):

scene->Preprocess = gathers data that is captured from capture sources and composited the frame together, as in the preview window. If this time is high, then usually that's a problem with a capture method. Usually, I see this number being abnormally high when someone tried to use Monitor capture with Aero enabled.

video encoding and uploading = sending the frame to be encoded to x264 from OBS
- CopyResource = copying resources from memory, more or less. This includes grabbing data from the GPU for game capture and directshow devices like capture cards. If this number is high, often it's a problem with the GPU or some other slowdown in memory somewhere.
- conversion to 4:2:0 - I have never seen this part be a problem, I think it's relatively simple
- call to encoder = this should usually be the part that takes the most time. This is the call to x264 to encode the frame. If everything else is low and this is really high, high enough to give you lagged frames, then the encoder is working too hard for your CPU to output at your desired frame rate. High resolution, slower presets, demanding x264 parameters, and high FPS can cause this.
- sending stuff out = actually sending the frame data to the RTMP server

That is my flawed understanding of how the profiler works. I more or less look at a few key areas to identify the parts that cause the most common slowdowns. I'm not sure you should take my word for this, though...Jim or R1CH would be the ones who could explain it best.

If someone who can explain it better wants to correct my mistakes, please do.
 

zerocul

Member
Thanks! So, if I have 1.35 ms instead of 16.6 (I steam with 60 fps) - it is very good? And what about percents? It's percent from all cpu load or just cpu usage only for OBS itself? Or it may be something else? :D
 

Krazy

Town drunk
The %'s stuff is just the percentage of the total frame time each part takes, what's more important is the ms numbers
 

ThoNohT

Developer
If all is well, those percentages are consistent with the ms numbers. It's just a slightly easier way of seeing which part takes the longest. For your log, you can see 65% is a call to the encoder. In total, 32.6% is unaccounted for (unknown where it happened). That's pretty normal.

So what you can conclude is that your capturing is very efficient, takes hardly no time at all, the most time is spent encoding (normal). And indeed with 1.3ms for a single frame, your hardware is going to have no trouble at all streaming at 60fps.
 
Top