obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.68k stars 7.81k forks source link

macOS Screen Capture stops working after waking from sleep #8928

Closed JacksonChen666 closed 6 months ago

JacksonChen666 commented 1 year ago

Operating System Info

macOS 13

Other OS

No response

OBS Studio Version

29.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/6rGLVnQlA1EhExs7

OBS Studio Crash Log URL

No response

Expected Behavior

macOS Screen Capture continues to work (capture) after waking from sleep.

Current Behavior

macOS Screen Capture freezes after waking from sleep.

Steps to Reproduce

  1. Open OBS
  2. Have a macOS Screen Capture source (Add if necessary)
  3. (Optional) Start recording
  4. Close lid (or go to sleep)
  5. Open lid (wake from sleep)
  6. Experience the issue

Anything else we should know?

gxalpha commented 1 year ago

We added a "Restart Capture" button to the properties of the source in OBS 30.0 that should be enabled when certain stoppages of capture (computer goes to sleep, user stops capture via menu bar in macOS 14) are detected. Could you try if that button is enabled when the computer wakes up again, and if pressing it fixes the problem?

JacksonChen666 commented 1 year ago

Could you try if that button is enabled when the computer wakes up again, and if pressing it fixes the problem?

The first time I started OBS 30 beta 2, for some reason, the restart button didn't do much other make it output nothing and the display setting had no items anymore. Logs

After restarting OBS, the restart button does work. The capture continues working. Logs

Although, the button is quite far away (multiple clicks away), and that doesn't really seem that practical.

mattymatty commented 7 months ago

same issues happens to me

RytoEX commented 6 months ago

The Apple sample app does the same thing as OBS here, so this seems like intended behavior for ScreenCaptureKit. Closing as such.

baardbi commented 4 months ago

This has happened to me several times now. If I do some recording of webcam and macOS screen capture for a little while, it works fine. Then I stop the recording and go to lunch (leaving the OBS application open). Then I come back and start recording again, and when I'm done I see that (in the recorded video) only the webcam recording is shown in front of my desktop wallpaper. None of the applications (or mouse pointer, app windows etc.) I use during the recording is shown in the finished video. Just me in front of the desktop wallpaper. If I close the OBS recording before going to lunch and open it when I come back and start recording, it work just fine. The problem is that I sometimes forget to do that, and it's super frustrating when I have recorded an hour of a tutorial video for something.

thefrostypixel commented 4 months ago

I don't understand why this has been closed. It's really annoying to have to manually go to OBS, right click the screen recording, select properties and press Restart Capture every time my mac wakes back up, and I don't see any reason for it being that way. Just because an Apple app does it this way that doesn't mean it's convenient or logical in any way.

rafalsk commented 3 months ago

also I do not understand, we are using OBS like a lot (gridnet.org) and this behaviour of OBS is real pain the ass on mac OS.

Basically all our scripts get broken after single session. Mac OS goes to sleep - everything broken all over again.

lauhub commented 3 months ago

I have the same problem and it is really a pain...

If it is possible to put a button to "Restart capture", why OBS couldn't be able to restart it automatically, without human action ?

At least an option should be available to allow this. And capture should be restarted automatically when resuming recording or streaming, or starting a new one.

Should we create a new issue for this ?

RytoEX commented 3 months ago

Should we create a new issue for this ?

No. GitHub Issues are not feature requests, they are for bug reports. A request to add an option or to change OBS behavior from in the manner described above is a feature request.

If it is possible to put a button to "Restart capture", why OBS couldn't be able to restart it automatically, without human action ?

See this comment on the PR that introduced the button:

Is there anything that prevents us from just restarting the capture without the user having to manually do it? Yes, the fact that the user explicitly chose to stop the capture. I guess for the other failures (sleep etc) that could be an option.

The challenge then becomes how to make sure we never accidentally re-enable capture when the user has explicitly chosen to stop the capture. I do not know if there is even a way to tell the difference programmatically. We had, and still have, little to no interest in trying to be "smart" when consent/permissions were involved in this case.

The fact that the Apple sample app does the same thing as OBS here indicates to us that ScreenCaptureKit does not by itself support resuming an active capture session that is interrupted by system sleep, so our implementation is "working as designed". Generally speaking, we consider the system changing power states while OBS is running to be disruptive and not something we're super interested in working around. Quitting OBS before putting your system to sleep is the best way to avoid unexpected behavior.