This example project is intended to present the simplest possible implementation of a CoreMediaIO DAL plugin for creating a virtual webcam on macOS. Apple provides sample code (also modernized by @lvsti) but it's extremely painful to read and modify.
The goal is for this plugin to serve static frames as a virtual webcam to host software (QuickTime, OBS, Chrome, etc)
Other projects that have implemented a DAL plugin are probably going to give the most insight as to what is missing here.
These projects are direct copies of Apple's own sample code.
- lvsti/CoreMediaIO-DAL-Example
- johnboiles/obs-mac-virtualcam - A fork of @lvsti's repo but adapted to work with OBS.
This project seems significantly different than the Apple sample code in its implementation.
Other examples would be helpful!
To try this out:
- Build it in Xcode
- Find
CMIOMinimalSample.plugin
in Xcode's 'Products' folder - Right click
CMIOMinimalSample.plugin
and choose 'Show in Finder' - Copy the plugin bundle to
/Library/CoreMediaIO/Plug-Ins/DAL/
- Open QuickTime
- Watch the logs in Console.app for any logs prefixed with
CMIOMS
You may also need to change the codesigning to use your own personal developer identity.
Also take a look at Cameo by @lvsti. It allows you to inspect DAL plugins and see all their properties at a glance. It might be helpful to take a known-working plugin (perhaps johnboiles/obs-mac-virtualcam or Snap Camera and try to figure out the differences between those plugins and this plugin.
This software is licensed as MIT. Do what you want with it! But please, if you find ways to improve this software, or you find bugs, please open a Pull Request so others can benefit from it!