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
60.19k stars 7.97k forks source link

"MacOS Screen Capture" does not correctly restart capturing when restarting the game #11276

Closed lesha-co closed 1 month ago

lesha-co commented 1 month ago

Operating System Info

macOS 14

Other OS

No response

OBS Studio Version

30.2.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/wBdkxuHBQqHoywWa

OBS Studio Crash Log URL

No response

Expected Behavior

When restarting the game that I've added as a source, OBS should restart window capturing

Current Behavior

OBS forgets the window

Steps to Reproduce

  1. Add "MacOS Screen Capture" source with following settings
    • method: Window Capture
    • window: any window, fullscreen or not

(the window is correctly added to the scene)

  1. Restart the application that you've added

(OBS shows freeze frame from before you've exited the application, and doesn't restart the capture)

  1. enter "MacOS Screen Capture" settings again

Window dropdown shows whatever is first in the list instead of whatever you've selected in (1), "Restart capture" button is disabled. Manually selecting the window helps, but that's what the button is there for, isn't it

Anything else we should know?

No response

lesha-co commented 1 month ago

the logs read

init_screen_stream: Invalid target window ID: 174226

I guess it remembers the window ID and not window name which makes sense but I'd love it to try and find the window by name if it can't find it by ID because that's what I do

which leads me here

https://github.com/obsproject/obs-studio/blob/7a35d7c549179cceeb8ca48d1ed256105c8357f4/plugins/mac-capture/mac-sck-video-capture.m#L139C17-L139C27

gxalpha commented 1 month ago

As you have correctly identified, this is expected and intended. If you close an app and open it again, it's a different window, so window capture does not pick it up.

If you want your app to stay captured, consider using Application Capture instead.

lesha-co commented 1 month ago

I would love to, but the "expose" function on macOS affects recording

image

it's almost like Application Capture captures entire screen, ignoring all other windows

and if I open the game in full screen, it works fine until I decide to swipe out of it It's hard to tell what I mean exactly, here's another screenshot, in the middle of a swipe

Screenshot 2024-09-13 at 3 23 27 PM

would it be considered a bug and should I open another issue about it?

gxalpha commented 1 month ago

Is your screenshot from Application Capture? I.e., does that show other apps even though it shouldn't? In that case, yes, please open another bug with specific information on your version of macOS and specific steps to reproduce. It's unlikely we would be able to solve that ourselves but might be able to raise it with Apple.