This is an implementation of camera extension app (as shown in this WWDC video). It will add a new device to the OS and will appear when navigator.mediaDevices.enumerateDevices()
is called.
More info on developing camera extensions can be found here.
- apple dev team credentials
- gstreamer (>= 1.22.0)
for a bare-bones, gstreamer-less boilerplate template version, checkout
boilerplate-template
branch
- open
daily-virtual-camera.xcodeproj
in xcode - select the
Daily Virtual Camera
scheme
$ cp $HOME/Library/Developer/Xcode/DerivedData/daily-virtual-camera-.../Build/Products/Debug/daily-virtual-camera.app /Applications
- open daily-virtual-camera.app from /Applications and click install virtual camera
- follow prompts to allow installation
After install, the camera will be in devices list, even after the installation app is closed. That's it!
$ systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.cmio
enabled active teamID bundleID (version) name [state]
* * EEBGKV9N3N co.daily.daily-virtual-camera.cam (1.0/1) cam [activated enabled]
$ ffmpeg -f avfoundation -list_devices true -i ""
...
[AVFoundation indev @ 0x7fb15bf05700] AVFoundation video devices:
[AVFoundation indev @ 0x7fb15bf05700] [0] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7fb15bf05700] [1] Daily Virtual Camera <========================
[AVFoundation indev @ 0x7fb15bf05700] [2] Capture screen 0
- update the camera name if changed
- use the javascript snippet in your browser console.
- optional: pass in different fake media
await initGUM('Daily Virtual Camera', 'https://bestfakemedia.biz/faux.mp4')
open the app and click uninstall and go through the security & privacy permissions song and dance. note: device will not be fully uninstalled until the computer is rebooted.
$ systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.cmio
enabled active teamID bundleID (version) name [state]
EEBGKV9N3N co.daily.daily-virtual-camera.cam (1.0/1) cam [terminated waiting to uninstall on reboot]
If you want to generate your own fake media within the app, main.swift is where you can change the camera name and you can also do more interesting camera things like changing the default GStreamer video source... Go wild.