• Stars
    star
    210
  • Rank 187,585 (Top 4 %)
  • Language Objective-C++
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Intended to be the most minimalistic example of a macOS CoreMediaIO DAL plugin.

CoreMediaIO Device Abstraction Layer (DAL) Minimal Example

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 plugin in this repo serves frames as a virtual webcam to host software (QuickTime, OBS, Chrome, etc)

Donating ๐Ÿ’ธ

If this code is useful to you, feel free to send some cash my way to fund coffee for more late night endeavors like this! I definitely sacrificed sleep several nights to get this thing to work since Apple's docs & sample code are so bad for these APIs. Feel free to Buy Me a Coffee or PayPal me.

Buy Me A Coffee

Other Examples ๐Ÿ‘€

Other projects that have implemented a DAL plugin:

Projects based on the code in this repo:

  • johnboiles/obs-mac-virtualcam - This project was my motivation to build this example code. It was originally based on Apple's sample code but is now based on the code in this repo. Creates a virtual camera from the output of Open Broadcaster Software (OBS).
  • Cascable Pro Webcam - Very cool piece of software that allows you to use your DSLR as a webcam.

If there are more examples to include here, please share by opening an issue!

Developing ๐Ÿ› 

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 was very useful to me to take a known-working plugin (like lvsti/CoreMediaIO-DAL-Example and Snap Camera) and then use Cameo to understand the differences between those plugins and this plugin.

Before Shipping Code

Before you bundle this code into your software, you should change the class names to something unique! Objective-C doesn't have namespaces and so if you keep the classes named Stream, Device, ObjectStore, PlugIn etc your plugin may not work if you use it along with someone else's plugin who also didn't change the names. This can cause real bugs where your plugin won't work if someone else's plugin is installed. Typically in Objective-C you add a few letters to the front of your classes to make them unique (e.g. JBStream, JBDevice, JBObjectStore, JBPlugin).

You must also change the plugin UUID to something unique in the Info.plist. The sample uses 8457B77A-D0304458-B136-8BB5335F4512 which must be changed to a new UUID of your choosing, in both "Plug-in factory interfaces" and "Plug-in types" entries.

License โš–๏ธ

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! Also I'd love to see what you built with it, so please open an issue or hit me up on Twitter and show me what you've made!

More Repositories

1

obs-mac-virtualcam

ARCHIVED! This plugin is officially a part of OBS as of version 26.1. See note below for info on upgrading. ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰Creates a virtual webcam device from the output of OBS. Especially useful for streaming smooth, composited video into Zoom, Hangouts, Jitsi etc. Like CatxFish/obs-virtualcam but for macOS.
Objective-C++
4,063
star
2

BaofengUV5R-TRRS

Tiny board that allows you to connect the Baofeng UV5R radio to a smartphone or other device that uses a TRRS connector for audio.
378
star
3

esp-roomba-mqtt

ESP8266 MQTT Roomba controller (Useful for hooking up old Roombas to Home Assistant)
C++
199
star
4

JBKinectHacks

A collection of sample projects and code snippets using OpenNI and the Kinect.
C
71
star
5

esphome-hdmi-cec

ESPHome component to send and receive HDMI-CEC messages.
C++
62
star
6

JBDaylightOverlay

An overlay for MapKit that shows daylight for the current date and time.
Objective-C
60
star
7

esp-garage-opener

(DEPRECATED: Use ESPHome instead) Control your garage door over MQTT with Home Assistant.
C++
36
star
8

hotspot_autologin

Script to automatically log into wifi hotspots that redirect to an agreement page before allowing access.
Python
33
star
9

ARDroneSDK

Fork of Parrot's official ARDrone SDK
C
29
star
10

homeassistant-config

My Home Assistant and ESPHome configs
HTML
24
star
11

home-assistant-purpleair

Forked from https://gitlab.com/gibwar/home-assistant-purpleair
Python
14
star
12

NMEAProxy

Tool for forwarding NMEA messages from TCP sockets and serial ports.
Python
12
star
13

xcasset_exporter

Short script for exporting images in .xcassets bundles to individual image files.
Python
12
star
14

pi-rtlsdr-igate-docker

Dockerfile for running an APRS IGate on a RaspberryPi with an attached RTL-SDR dongle
Shell
11
star
15

Helm-firmware

A data translator for your boat networks. Connects to SeaTalk, NMEA 0183, and USB.
C++
9
star
16

trackuino

The Arduino APRS Tracker
C++
9
star
17

Helm-hardware

A data translator for your boat networks. Connects to SeaTalk, NMEA 0183, and USB.
Eagle
9
star
18

CocoaOpenNI

Sample project for using OpenNI in a Cocoa OSX app.
C
8
star
19

tinytrackuino

Small Trackuino-compatible board for transmitting APRS packets over 2m amateur radio.
Prolog
7
star
20

rtl-433-docker-pi

Dockerfile and related SystemD unit file for running rtl_433 inside Docker on a Raspberry Pi.
Dockerfile
5
star
21

Helm-ios

iOS app for controlling SeaTalk-based autopilots on boats.
C++
4
star
22

esp-fan-controller

(DEPRECATED: Use ESPHome instead) MQTT fan controller with an ESP12 to drive a PWM input to a mosfet.
C++
4
star
23

Dimlet

A portable, network-controlled light dimmer that can be controlled from an iOS application.
Objective-C
3
star
24

air-sensor

(DEPRECATED: Use ESPHome instead) Esp8266 Air Sensor (temp, humidity, co2, particulates) for reporting to Home-Assistant
C++
2
star
25

replaycam

Simple webserver for Raspberry Pi that exposes an endpoint for saving the last n seconds of video from the Raspberry Pi Camera Module.
Python
2
star
26

Steer

iOS app for driving a remote controlled car from an iPhone w/ IP camera FPV.
Objective-C
2
star
27

JohnBoiles-Eagle-Libraries

Custom Eagle Libraries
2
star
28

BurnBabyBurn

Tiny board for controlling a high-power logic-level n-channel MOSFET transistor. Useful for burning stuff (like nichrome wire). Can be used as a timed cut-off for high-altitude ballooning.
Arduino
2
star
29

XcodeSnippets

A collection of XcodeSnippets I found useful
Objective-C
1
star
30

projects

Write-ups on things I've built
1
star
31

pi-oled-docker

A Dockerfile and Python script for driving a small OLED display from a Raspberry Pi.
Python
1
star
32

esp-mqtt-irblaster

(DEPRECATED: Use ESPHome instead) ESP8266 MQTT IR Blaster. Useful for hooking up IR gear (TVs, ACs, sound bars) to Home Assistant (and probably other things).
C++
1
star
33

pi-oled

Code for running a small OLED attached to a RaspberryPi to show some system stats. (Note: ChatGPT helped make this)
Python
1
star
34

CupsPi

Raspberry Pi image builder for a CUPS print server
Shell
1
star
35

rtl-sdr-homekit

Project to bridge RF sensors to Apple Homekit using a rtl-sdr dongle.
Go
1
star
36

IBMF-Font-Editor

C++
1
star
37

stacks-ios

iOS SDK for the upcoming Stacks environment management tool.
Objective-C
1
star
38

KinectWings

Kinect controller for quadcopters.
Objective-C
1
star
39

scad-pegboard

OpenSCAD models for the pegboard on my walls.
OpenSCAD
1
star
40

OpenVSD

A small board and accompanying Arduino firmware that allows you to turn a normal diaphragm pump into a variable speed diaphragm pump.
C
1
star
41

scad-lego-stepper

Originally based on Thing 1674077 (by rainerunsinn I think) from Thingiverse
OpenSCAD
1
star