Question / Help Canvas dropping frames/stuttering regardless of settings

HDL

Member
I've tried changing all kinds of settings. Resolution, vsync, color format, all relevant capture types (display, Syphon, window), frame rates, etc. No matter what, the video will start smooth and is then followed by an intermittent frame stutter every several seconds. The stutter itself lasts a few seconds before the video continues being smooth for a while.

The stutter is visible during streams and recordings, however it's always on the canvas regardless of streaming/recording. When I open the Stats window, OBS does not report any rendering or encoding lag. I am comparing the canvas to an input source that has graphics that flicker every frame at 60 FPS (makes noticing discrepancies trivial). However for a more objective test, I also record a video with Syphon Recorder and do not see the stutter. All of this happens regardless of what input source I use.

Check log file for hardware and software used.
 

Attachments

  • 2018-04-14 19-02-18.txt
    4.4 KB · Views: 61

Narcogen

Active Member
Log does not contain a streaming session. You need to start it, run for awhile (until you see the problem) then stop the session and capture the log. Your linked log contains only app startup.
 

HDL

Member
As I said before, you don't need to start a session. The problem can be seen on the canvas just by having OBS running.

But here is a log from a live session. During this I had the Stats window open and it reported 0 frames lost.
 

Attachments

  • 2018-04-15 09-33-08.txt
    11.6 KB · Views: 36

Narcogen

Active Member
Okay. I can't seem to duplicate this problem on my side but it's possible I just don't have enough information on your setup-- what you're trying to capture and how, aside from what is in the log.

What I do see in your log that I don't see in mine is:

09:33:08.655: Failed to load 'en-US' text for module: 'obs-browser.so'
09:33:08.655: obs_register_source: Source 'browser_source' already exists! Duplicate library?


Does the browser source work, and are you using it? This might indicate something went wrong during installation, or a problem with High Sierra that does not occur in Sierra.

09:33:08.780: obs-data.c: [obs_data_create_from_json] Failed reading json string (1): '[' or '{' expected near end of file

The scene and scene collection files are .json files. This might indicate one has become corrupt, meaning it might be a good idea to delete your scene and recreate it. I have had problems with corrupt scenes in the past, usually involving sources dependent on plugins that have problems after updates, so again, this may not apply to you.

09:33:08.988: Unexpected pixel format: 0 (

This seems to indicate OBS is getting something from your video source that it doesn't expect. Not sure what you can do about that. I see it in a lot of logs where people have problems, but I've never seen it in one of my own.

09:33:08.444: fps: 59922/1000

This looks like odd notation for FPS to me. What displays in your framerate under video settings?
 

HDL

Member
Browser Source works but I am not using it. This is a barebones scene with a single element in it. I tried deleting the scene and making a brand new one, no good.

As for pixel format, this log is from a session where I captured with Syphon (raw RGB), but again the issue persists regardless of what capture type I use.

For FPS, I mentioned that I tried all kinds of values including a flat 60. The one I use here is for 59.92 which looks odd but is the native rate that a Genesis outputs at. It's not the culprit.
 

HDL

Member
All right so I did some more testing and learned a bit more. Firstly, the 59.92 FPS was a contributing factor, but not the only one. I set it to 60 and got better results. Instead of getting intermittent drops, I instead got many drops if certain conditions were met, and smooth video if they weren't. To see this better, I made a couple videos you can download here. I recommend viewing them with something like ffplay to guarantee the playback is correct. I've attached the corresponding logs to these sessions as well.

https://ln.sync.com/dl/39fa9ca20#6y2pjvzp-v5wgaitr-uekssz3s-c2rmzg48
https://ln.sync.com/dl/2d01fb470#ma4ht3p8-nyrs43fe-dchdverk-id8w7nhg

The main observations I made:
  • Additional sources increase the frame drops, regardless if they're being used or not.
  • If OBS is visible but not in focus, it drops frames.
For these tests I looked at the objects on the bottom left. They flicker constantly going from red to blue every frame. I periodically used ⌘Tab to switch between the source and OBS. You can see in that first video that when OBS is not focused, there are massive frame drops. At around 2:38 (in-game) I completely hid the OBS window and then put the source in focus.

In the other video, you can see minor drops at the moment I switch focus, but the video remains mostly smooth with only occasional skips, and honestly this would not even be noticeable in real time without flickering objects.

Something about adding more sources and whether or not OBS is in focus/visible is causing drops, even if you simply have OBS open and don't have an active session.
 

Attachments

  • Multiple Sources.txt
    12.1 KB · Views: 22
  • One Source.txt
    11.9 KB · Views: 26

Narcogen

Active Member
I think another contributing factor may be High Sierra. I have lots of scenes with more sources and I'm also using an RX580, and I don't see the behavior you describe-- possibly because I am still on Sierra.
 

HDL

Member
This used to happen on Sierra too.

Did more testing, got some interesting results. For Syphon capture I found a workaround. In SyphonInject there is an option called "Change Buffer." Using that made OBS instantly stop dropping all the frames and was perfectly smooth. This doesn't explain why it was happening to begin with, but at least it's a solution. Example:

https://ln.sync.com/dl/57a6f11c0#7ba7zzvf-3thrpy53-9puvsycn-6rbvgzsn

Next I tested display capture and got weird results. It was smooth until I tabbed out to an application on my other display, after which it exhibited massive drops. Tabbing back to OBS or the source did not fix it. What did fix it was hovering the mouse on the canvas. Tabbing to other apps on the same display as OBS didn't cause drops. This behavior sort of happens with Syphon capture too, but to a far lesser extent. There are occasional drops, but they are minor. The same fix works to achieve perfect smoothness (after the aforementioned Change Buffer solution). I don't have technical knowledge on how OBS works, but to me it looks like something is interfering with how OBS updates the canvas. Here's a video of this happening:

https://ln.sync.com/dl/78f3a5d60#emwpnaaa-tnhicwyp-4n2gxajt-yinc4vdz

As an aside, the "Simple Client" app, also made by the Syphon developers, never exhibits these drops regardless of which buffer is being used. I had it open the entire time just to make sure nothing funny was happening with Syphon itself. I did notice that by default it was 1 frame behind the source, but after changing the buffer there was no delay.
 
Last edited:

HDL

Member
Learned something else that's also a bit of a problem. Syphon servers don't output at a constant rate, they use variable (average) rate based on the activity of the source. So if you use a source that allows you to freeze all video entirely (emulator pause in this case), the Syphon server will drop the FPS as far down as 1 if you wait long enough. You can see this by using Simple Client and using frame advance in your source to make it update the reported FPS.

Well I guess OBS doesn't like this, because doing this makes it start to drop frames even after using Change Buffer. Most of the time the drops are minor, however I've seen it drop a lot a couple times (probably a bad average rate). The mouse hovering thing fixes this too, but ideally it shouldn't happen at all. If it behaved the way Simple Client did, then we'd be golden.
 
Top