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

OBS not detected by pyvirtualcam: 'obs' backend: OBS Virtual Camera is not installed #9680

Closed
agilebean opened this issue Oct 9, 2023 · 9 comments

Comments

@agilebean
Copy link

agilebean commented Oct 9, 2023

Operating System Info

Other

Other OS

macOS 14.0

OBS Studio Version

30.0.0-beta3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/uIv0BhBahWq0jYBM

OBS Studio Crash Log URL

No response

Expected Behavior

The OBS virtualcam is detected by pyvirtualcam by the following Python script:

        self.virtualcam = pyvirtualcam.Camera(
            # set standard dimensions, see https://github.com/letmaik/pyvirtualcam/issues/110#issuecomment-1624273288
            width=1280,
            height=720,
            fps=30,
            device="OBS Virtual Camera",
            fmt=pyvirtualcam.PixelFormat.BGR
        )

Current Behavior

The OBS virtualcam is NOT detected by pyvirtualcam.

RuntimeError: 'obs' backend: OBS Virtual Camera is not installed in your system. Use the Virtual Camera function in OBS to trigger installation.

Steps to Reproduce

  1. installing OBS 30.0.0 beta3
  2. granting security rights in systems preferences
  3. launch OBS Studio
  4. start and stop Virtual Cam in OBS Studio
    ...

Anything else we should know?

The virtualcam is detected by Zoom or Google Meet.
However, not by the Python script, which worked fine with the previous macOS versions 13.x

@Penwy
Copy link
Contributor

Penwy commented Oct 9, 2023

The OBS virtualcam on mac has been changed in OBS 30, in order to be able to work for macos 14, it's likely that this python package will have to be updated as well to work with the new one, this should probably be reported to the maintainers of that package.

@agilebean
Copy link
Author

agilebean commented Oct 9, 2023

The OBS virtualcam on mac has been changed in OBS 30, in order to be able to work for macos 14, it's likely that this python package will have to be updated as well to work with the new one, this should probably be reported to the maintainers of that package.

@Penwy
Great, thanks a lot!

Can you please point to the code which I can report to the pyvirtualcam maintainers?

@Penwy
Copy link
Contributor

Penwy commented Oct 9, 2023

No idea, never used that package

@agilebean
Copy link
Author

No idea, never used that package

I meant the code with OBS studio which was changed for the virtualcam update...

@gxalpha
Copy link
Member

gxalpha commented Oct 9, 2023

Pyvirtualcam hacks into our virtualcam component and as noted above this is their problem, please report it to them. Our old virtualcam doesn't work anymore at all with macOS 14.
If you want code to point them to, have them look at the mac-virtualcam plugin.

@agilebean
Copy link
Author

It would be great if someone friendly and knowledgeable could give a more insights about the following.
The motivation is obviously to find a solution that would allow the continuous use of OBS on macOS 14 - relevant for an increasing number of users in the future.

Core Question:

Why does OBS 29 install on macOS 14 but does not render an image in the OBS virtual camera?

More specifically:

a) Was the DAL plugin disabled in OBS 30 because it doesn't work on macOS 14 any more?
That would explain why reverting to OBS 29 on macOS 14 wouldn't work either.

b) What is the specific reason why the DAL plugin doesn't work for macOS 14?
That would help finding a workaround.

Of course the goal is to find a workaround that avoids downgrading macOS.

Thanks for any brainstorming!

@RytoEX
Copy link
Member

RytoEX commented Oct 17, 2023

Core Question:

Why does OBS 29 install on macOS 14 but does not render an image in the OBS virtual camera?

More specifically:

a) Was the DAL plugin disabled in OBS 30 because it doesn't work on macOS 14 any more? That would explain why reverting to OBS 29 on macOS 14 wouldn't work either.

Yes.

b) What is the specific reason why the DAL plugin doesn't work for macOS 14? That would help finding a workaround.

DAL plugins are completely disabled in macOS 14. See the WWDC 2022 talk on CMIO Camera Extensions where this timing was announced.

OBS Studio 30 (currently in RC) uses a CMIO Camera Extension for the Virtual Camera, which does work on macOS 14.

@gxalpha
Copy link
Member

gxalpha commented Oct 17, 2023

Regarding fixes / workarounds: There is no way to make a DAL plugin work on macOS 14.
The trouble with DAL plugins is that they are insecurely designed which is why nearly no apps load them. This lead to the virtualcam pretty much only working in Chrome and OBS itself. CoreMedia IO System Extensions fix this flaw and work in all apps. This is why we switched to them on macOS 13 as well with OBS 30 (technically they are available since macOS 12.3, but pretty buggy until 13). If you’re still on macOS 13, going back to OBS 29.1 will use the DAL plugin again.

If you want to send frames to the system extension, you need to use the CoreMedia IO C API. You can check out how we do it at https://github.com/obsproject/obs-studio/blob/master/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm.
Beware that macOS generally doesn’t like when someone accesses video devices outside of app bundles, at least for source streams via the AVFoundation/AVKit abstraction (as in: It terminates your process immediately if you do so). I’m not sure how that’s handled when using the CMIO C API for sink streams, but I could imagine it being the same, your milage may vary.

@agilebean
Copy link
Author

@gxalpha
Thanks a lot for the detailed explanation, that was very helpful.
I understand now that the only way to keep running pyvirtualcam with OBS 29.1 is to downgrade macOS from 14 to 13 which will allow the DAL plugin to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants