12min • 12 October 2020
Disclaimer: This post becomes quite technical at some point where we're using developer tools such as a terminal and Xcode. We also fiddle with security mechanisms, so try it at your own risk!
If you're working from home due to Corona, chances are that you're participating in way more online meetings than you'd usually do. I've been working remotely for almost 2 years now and the number of online meetings has grown rapidly.
While meeting online is quite effective, one can quickly miss the in-person interaction; especially when you don't have an active webcam. I usually use a single big display to work on, so my Macbook is closed and I can't use its built-in webcam, which has a bad quality anyway.
I already considered buying an external webcam, when my friend and co-worker Daniel(new tab) told me about his experiments with OBS and his iPhone camera. After some research, we found an article(new tab) by Josh Spicer(new tab) who used OBS(new tab) and obs-mac-virtualcam(new tab) to utilize his old iPhone as a mac webcam.
Since the article already is a couple of months old and outdated to some degree, I decided to write my own blog post about it! We're also not enrolled in the Apple Developer Program(new tab) which lead to some extra work on our side.
Now, in order to see our phone screen, we need to add a Video Capture Device in the Sources Tab at the bottom.
Make sure that your iPhone is connected to your Mac via USB or else it won't show up in the Device dropdown. Select your iPhone and make sure to choose High from the Preset dropdown to ensure the best possible output quality.
You should now be able to see your iPhone screen inside the scene preview. Next, we want to rotate and center it so that it fills the preview. Right-click on the source and navigate to Transform. Here we'll be able to do all kinds of manipulations.
I usually start with Fit to screen followed by Rotate 90 degrees CW.
Then I use the cropping tools to scale my screen all the way up until it fully covers the preview box.
Note: We need to cut some pixels on both ends in order to make it fit the box.
In the end it should look something like this:
Don't worry about the details right away, because we'll need to adjust the screen once again anyways.
We can now see our phone screen in OBS, but we can't use it as a webcam just yet.
To achieve that, we need to somehow export our video output as a virtual cam for apps to recognize it as an actual webcam.
Luckily, there's an OBS plugin called obs-mac-virtualcam(new tab) which does exactly that.
Jump over to the Releases(new tab) section and download the latest
Once installed, you should see a Start Virtual Cam option under Tools in the OBS menubar.
Start the virtual cam and your OBS scene is now available as an external webcam!
Let's test it: Head over to QuickTime Player and try File > New Movie Recording and you should be able to select your OBS Virtual Cam right next to the "Record"-button.
If there's no OBS Virtual Cam option, something went wrong in the setup process. Maybe restart OBS or try a clean setup once again.
We can see our iPhone screen in OBS, but it's not really a good webcam quite yet.
We could open the native camera app, to get the camera input. But, since OBS just mirrors the phone screen, you'll quickly find that there's a lot of distracting UI which we'd have to crop in order to get a real webcam feeling.
So, ideally we'd want a "camera" app that has little or no UI.
There are plenty of options in the App Store, but I found an app which I personally like a lot: ShutterCast(new tab).
It has no UI elements and we only need to crop away some padding on both ends.
A free alternative is Instagram's Hyperlapse(new tab) which comes with a very minimal UI.
Once the camera app of your choice is active, go over to OBS and manipulate the scene until it nicely fits all edges.
Tip: I use a flexible camera stand(new tab) which is attached to my desk and sits behind my external display.
That way I can adjust my desk height without having to readjust the phone stand every time.
Alright, now we are all setup with OBS and got a nice webcam output. One might think we're already done at that point, but it turns out to be way more complicated. Most apps won't initially support or even recognize the virtual cam and the reason is Apple's security policy(new tab): The operating system is not allowing any libraries not signed by the same App ID.
So what we ultimately need to do, is resigning our apps with our own certificates.
Warning! Resigning applications actively disables security mechanisms that are there for a reason. I take no responsibility from here on. Try it at your own risk.
In order to be able to use the
codesign CLI, Xcode(new tab) including its Command Line Tools need to be installed on your machine.
Before we're able to sign apps, we need our own Apple Developer certificate.
If you have a paid Apple Developer account, you should be able to skip this part entirely.
Note: This does NOT require a paid Apple Developer account.
Open Xcode and navigate to File > Preferences in the menubar.
Select the "Account" tab and follow these steps:
If there's no certificate present already, go ahead and create a new Apple Development certificate.
Last but not least, we need to get the full title of the certificate we just created.
Apple Development: firstname.lastname@example.org (ABCD123)
Now we should be all setup to finally start signing our apps and see some results!
Edit: The latest version of Zoom now officially supports third-party virtual cameras, so we shouldn't need to sign it anymore.
Zoom(new tab) can be signed with a single command:
sudo codesign -dv "/Applications/zoom.us.app"
Et voilà, we can now select our OBS Virtual Cam in the video settings!
Microsoft Teams(new tab) is similarly easy, although we need to sign both the actual Microsoft Teams.app as well as its Helper.app which runs in the background.
sudo codesign --remove-signature "/Applications/Microsoft Teams.app"sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper.app"
Same company, same procedure.
Skype(new tab) also has a Helper.app which needs to be signed as well.
sudo codesign -f -s - "/Applications/Skype.app"sudo codesign --remove-signature "/Applications/Skype.app/Contents/Frameworks/Skype Helper (Renderer).app"
Trying to codesign Slack(new tab) the same way as the other apps above, I ran into some issues. Slack is based on Electron(new tab) and thus needs additional steps.
I came across electron-osx-sign(new tab) which is a wrapper around the
codesign CLI specifically built for signing Electron-based apps.
One can install it with npm(new tab) running:
npm install -g electron-osx-sign
If you do not have Node.js/npm installed on your machine already, go ahead and get the latest version(new tab).
Additionally, we'll be using a minimal
entitlements.xml file to sign those apps.
I created mine under
/Users/USERNAME/ or respectively
Let's create a new file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.cs.disable-library-validation</key><true /></dict></plist>
Now we can use the
electron-osx-sign CLI to sign any Electron-based app.
Here's where we also need that certificate title which we already got earlier.
electron-osx-sign "/Applications/Slack.app" \--type=development \--entitlements="~/entitlements.xml" \--gatekeeper-assess=false \--identity="YOUR_CERTIFICATE_TITLE"
If you have a paid Apple Developer account, you can leave the
--identity parameter as that should be pre-filled with your paid certificate automatically.
With a little bit of extra work, we can now use our iPhone in every major meeting software!
While I usually disabled my video in the past, I'm nowadays almost looking forward to my next meeting just because I enjoy the setup that much 🤷♂️.
If you run into trouble, please let me know via Twitter(new tab) and I'll try to update the article accordingly.