obs-mac-virtualcam icon indicating copy to clipboard operation
obs-mac-virtualcam copied to clipboard

DAL plugins don't work in apps with hardened runtime (e.g. in Zoom, Teams, Skype, Safari, Quicktime, Photo Booth etc)

Open ChrisWeiss opened this issue 4 years ago • 185 comments

I ran through the compile and everything seems to be fine, am able to run OBS from the terminal, but I'm not seeing any new video sources in Photo Both or Google Hangouts. The console output when launching indicates that it is loading the module (though there is some warning) Is there some other step I need to complete?

info: CPU Name: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
info: CPU Speed: 3100MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 16384MB Total
info: OS Name: Mac OS X (NSMACHOperatingSystem)
info: OS Version: Version 10.14.6 (Build 18G3020)
info: Kernel Version: 18.7.0
info: hotkeys-cocoa: Using layout 'com.apple.keylayout.US'
info: Portable mode: false
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 25.0.3-10-g094edda8 (mac)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
	samples per sec: 44100
	speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter ATI Technologies Inc. AMD Radeon Pro 560 OpenGL Engine
info: OpenGL loaded successfully, version 4.1 ATI-2.11.21, shading language 4.10
info: ---------------------------------
info: video settings reset:
	base resolution:   1680x1050
	output resolution: 1120x700
	downscale filter:  Bicubic
	fps:               30/1
	format:            NV12
	YUV mode:          601/Partial
info: NV12 texture support not available
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
error: os_dlopen(libpython3.7m.dylib->libpython3.7m.dylib): dlopen(libpython3.7m.dylib, 257): image not found

warning: [Python] Could not load library: libpython3.7m.dylib
2020-04-02 16:38:30.976 obs[31358:10316186] alloc
2020-04-02 16:38:30.976 obs[31358:10316186] query 2
2020-04-02 16:38:30.976 obs[31358:10316186] release 2
2020-04-02 16:38:30.976 obs[31358:10316186] ** MyPlugInitializeWithObjectID
2020-04-02 16:38:30.976 obs[31358:10316186] init
2020-04-02 16:38:30.976 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:30.976 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:30.976 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.050 obs[31358:10316186] Trying to get Surface
2020-04-02 16:38:31.051 obs[31358:10316186] Found Surface
2020-04-02 16:38:31.051 obs[31358:10316186] Surface is the wrong size: 320 240 vs 640.000000 480.000000
2020-04-02 16:38:31.051 obs[31358:10316186] Surface is 0x0
2020-04-02 16:38:31.052 obs[31358:10316186] Driver name is 8 CamTwist
2020-04-02 16:38:31.052 obs[31358:10316186] <CMVideoFormatDescription 0x7fdda2786280 [0x7fff9a70b8e0]> {
	mediaType:'vide'
	mediaSubType:'BGRA'
	mediaSpecific: {
		codecType: 'BGRA'		dimensions: 640 x 480
	}
	extensions: {<CFBasicHash 0x7fdda2783f70 [0x7fff9a70b8e0]>{type = immutable dict, count = 4,
entries =>
	1 : <CFString 0x7fff9aade618 [0x7fff9a70b8e0]>{contents = "CVFieldCount"} = <CFNumber 0x311cba1434bdec05 [0x7fff9a70b8e0]>{value = +1, type = kCFNumberSInt64Type}
	2 : <CFString 0xa62e8a0 [0x7fff9a70b8e0]>{contents = "CVBytesPerRow"} = <CFNumber 0x311cba1434b7ed05 [0x7fff9a70b8e0]>{value = +2560, type = kCFNumberSInt64Type}
	4 : <CFString 0x7fff9a984f90 [0x7fff9a70b8e0]>{contents = "com.apple.cmio.format_extension.video.only_has_i_frames"} = <CFBoolean 0x7fff9a70bc30 [0x7fff9a70b8e0]>{value = true}
	5 : <CFString 0x7fff9a970d18 [0x7fff9a70b8e0]>{contents = "FormatName"} = <CFString 0xa62e8c0 [0x7fff9a70b8e0]>{contents = "Component Video - CCIR-601 RGB"}
}
}
}
2020-04-02 16:38:31.052 obs[31358:10316186] Name CamTwist
2020-04-02 16:38:31.078 obs[31358:10316186] alloc
2020-04-02 16:38:31.078 obs[31358:10316186] query 2
2020-04-02 16:38:31.078 obs[31358:10316186] release 2
2020-04-02 16:38:31.078 obs[31358:10316186] ** MyPlugInitializeWithObjectID
2020-04-02 16:38:31.078 obs[31358:10316186] init
2020-04-02 16:38:31.078 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.078 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.078 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.078 obs[31358:10316186] <CMVideoFormatDescription 0x7fdda789aa30 [0x7fff9a70b8e0]> {
	mediaType:'vide'
	mediaSubType:'2vuy'
	mediaSpecific: {
		codecType: '2vuy'		dimensions: 640 x 480
	}
	extensions: {<CFBasicHash 0x7fdda789c840 [0x7fff9a70b8e0]>{type = immutable dict, count = 6,
entries =>
	0 : <CFString 0x7fff9aade798 [0x7fff9a70b8e0]>{contents = "CVImageBufferYCbCrMatrix"} = <CFString 0x7fff9aade7d8 [0x7fff9a70b8e0]>{contents = "ITU_R_601_4"}
	1 : <CFString 0x7fff9aade618 [0x7fff9a70b8e0]>{contents = "CVFieldCount"} = <CFNumber 0x311cba1434bdec05 [0x7fff9a70b8e0]>{value = +1, type = kCFNumberSInt64Type}
	2 : <CFString 0x7fff9aade8f8 [0x7fff9a70b8e0]>{contents = "CVImageBufferTransferFunction"} = <CFString 0x7fff9aade7b8 [0x7fff9a70b8e0]>{contents = "ITU_R_709_2"}
	4 : <CFString 0x7fff9a984f90 [0x7fff9a70b8e0]>{contents = "com.apple.cmio.format_extension.video.only_has_i_frames"} = <CFBoolean 0x7fff9a70bc30 [0x7fff9a70b8e0]>{value = true}
	5 : <CFString 0x7fff9aade878 [0x7fff9a70b8e0]>{contents = "CVImageBufferColorPrimaries"} = <CFString 0x7fff9aade8b8 [0x7fff9a70b8e0]>{contents = "SMPTE_C"}
	6 : <CFString 0x7fff9a970d18 [0x7fff9a70b8e0]>{contents = "FormatName"} = <CFString 0xa62e920 [0x7fff9a70b8e0]>{contents = "Component Video - CCIR-601 uyvy"}
}
}
}
2020-04-02 16:38:31.142 obs[31358:10316186] Name CamTwist (2VUY)
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: [VideoToolbox encoder]: Adding VideoToolbox H264 encoders
warning: Failed to load 'en-US' text for module: 'obs-mac-virtualcam.so'
warning: Ignoring old obs-browser.so version
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-mac-virtualcam.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     mac-vth264.so
info:     mac-syphon.so
info:     mac-decklink.so
info:     mac-capture.so
info:     mac-avcapture.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-ouput-ui.so
info:     coreaudio-encoder.so
info: ---------------------------------
info: ==== Startup complete ===============================================
error: Service '' not found
info: All scene data cleared
info: ------------------------------------------------
info: coreaudio: device 'Built-in Microphone' initialized
info: [Media Source 'Media Source']: settings:
	input:                   /Users/cweiss/Downloads/Binary_numbers_alpha_overlay_01_Videvo.mov
	input_format:            (null)
	speed:                   100
	is_looping:              yes
	is_hw_decoding:          no
	is_clear_on_media_end:   yes
	restart_on_activate:     yes
	close_when_inactive:     no
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.471 obs[31358:10316186] enog
2020-04-02 16:38:31.471 obs[31358:10316186] bolg
2020-04-02 16:38:31.471 obs[31358:10316186] 0
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.471 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.471 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.471 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] grrf
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] grrf
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] trfn
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] trfm
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] trfn
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] DN: CamTwist
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] dulp
2020-04-02 16:38:31.472 obs[31358:10316186] tpni
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.472 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.472 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.472 obs[31358:10316186] elt 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.472 obs[31358:10316186] enog
2020-04-02 16:38:31.472 obs[31358:10316186] bolg
2020-04-02 16:38:31.472 obs[31358:10316186] 0
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.472 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectSetPropertyData
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] grrf
2020-04-02 16:38:31.473 obs[31358:10316186] bolg
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] grrf
2020-04-02 16:38:31.473 obs[31358:10316186] bolg
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] trfn
2020-04-02 16:38:31.473 obs[31358:10316186] bolg
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] trfm
2020-04-02 16:38:31.473 obs[31358:10316186] bolg
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] trfn
2020-04-02 16:38:31.473 obs[31358:10316186] bolg
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] DN: CamTwist (2VUY)
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectHasProperty
2020-04-02 16:38:31.473 obs[31358:10316186] dulp
2020-04-02 16:38:31.473 obs[31358:10316186] tpni
2020-04-02 16:38:31.473 obs[31358:10316186] 0
2020-04-02 16:38:31.473 obs[31358:10316186] MyPlugObjectGetPropertyDataSize
2020-04-02 16:38:31.473 obs[31358:10316186] sel dnwo
2020-04-02 16:38:31.473 obs[31358:10316186] scope bolg
2020-04-02 16:38:31.473 obs[31358:10316186] elt 0
info: EyeSight: Selected device 'FaceTime HD Camera'
info: EyeSight: Using preset 1280x720
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Syphon Client' (syphon-input)
info:     - source: 'Media Source' (ffmpeg_source)
info:     - source: 'EyeSight' (av_capture_input)
info:         - filter: 'Crop/Pad' (crop_filter)
info:         - filter: 'Chroma Key' (chroma_key_filter)
info: ------------------------------------------------
info: adding 23 milliseconds of audio buffering, total audio buffering is now 23 milliseconds (source: Mic/Aux)

info: User Removed source 'Syphon Client' (syphon-input) from scene 'Scene'
info: EyeSight: Selected preset AVCaptureSessionPreset1280x720

ChrisWeiss avatar Apr 02 '20 23:04 ChrisWeiss

Yeah I've been running into sporadic code signing issues. Every now and then macOS will block the plugin from loading. I haven't been able to pin down why it only happens sometimes. Do you see anything in Console.app if you search for virtualcam?

johnboiles avatar Apr 03 '20 05:04 johnboiles

It shouldn’t be needed, but after a restart I got it (Google Meet on Chrome, but only shows sometimes on Photo Booth: this also happens with other virtual camera devices)

rberenguel avatar Apr 03 '20 06:04 rberenguel

Did you try a Google Meet meeting and the person on the other end was able to see you? I've been having trouble with this (see #2) -- I can see my own preview fine but the person on the other end reports my video as frozen.

johnboiles avatar Apr 03 '20 15:04 johnboiles

Yes I’ve seen your other issue. No, it was late and I just was confirming it seemed to work, this was only in the preview. The frame syncing you added didn’t fix the issue?

rberenguel avatar Apr 03 '20 15:04 rberenguel

Sure enough, I get the following in Console (even after a reboot): default 10:00:02.619975 -0700 Photo Booth Error loading /Library/

CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam:  dlopen(/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam, 0x0106): code signature in (/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam) not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
default	10:00:02.620077 -0700	Photo Booth	Cannot find function pointer AppleCMIODPSampleVCamPlugIn for factory <CFUUID 0x6000017270c0> 35FDFF29-BFCF-4644-AB77-B759DE932ABE in CFBundle/CFPlugIn 0x7f82913134f0 </Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin> (bundle, not loaded)

FWIW - This is a corporate laptop and it's pretty locked down. (I dont think I could get away with disabling SIP to get some of the other solutions to work).

ChrisWeiss avatar Apr 03 '20 17:04 ChrisWeiss

I've gotten this sometimes as well and it's baffling to me. One thing I'm trying is changing my codesigning identity to my personal developer account

diff --git a/src/dal-plugin/CMakeLists.txt b/src/dal-plugin/CMakeLists.txt
index c354f13c..a358bfc1 100644
--- a/src/dal-plugin/CMakeLists.txt
+++ b/src/dal-plugin/CMakeLists.txt
@@ -155,6 +155,6 @@ add_custom_command(TARGET dal-plugin

 add_custom_command(TARGET dal-plugin
        POST_BUILD
-       COMMAND /usr/bin/codesign --force --deep --sign - --timestamp=none ${TARGET_DIR}/obs-mac-virtualcam.plugin
+       COMMAND /usr/bin/codesign --force --deep --sign [my 40 char codesign identity] --timestamp=none ${TARGET_DIR}/obs-mac-virtualcam.plugin
        COMMENT "Codesign plugin"
 )

Then that assigns a Team ID during codesigning. But it doesn't explain why it sometimes works without a team id.

@ChrisWeiss does your locked down corporate laptop have Carbon Black on it? Mine does and I always give that thing a suspicious look when spooky system things like this happen.

johnboiles avatar Apr 03 '20 19:04 johnboiles

On this issue: I was only able to get video in quicktime. While in other apps like photo booth and discord i can select the virtualcam, it won't give output. For discord the preview shows a black screen, and the actual video shows that it is loading all the time; and for photo booth when i select the virtualcam, the picture of the facetime camera i had before just freezes. I know we're probably not at this point yet, but I just wanted to inform you about the issue. Also rebooting didn't help.

gxalpha avatar Apr 03 '20 22:04 gxalpha

Thanks for the additional info @gxalpha! Every bit is helpful to try to understand what is happening!

johnboiles avatar Apr 04 '20 00:04 johnboiles

I am experiencing this issue as well. I was able to get this plugin working on my employer laptop (which I believe is Mojave) but not on my personal computer which is on Catalina. I am able to see the virtual camera in Hangouts and Quicktime, but not Zoom or Photobooth. I tried to get a list of available input devices and got the following which makes me think that this is onto something:

$ system_profiler SPCameraDataType

2020-04-04 17:21:25.454 system_profiler[884:23513] Error loading /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam:  dlopen(/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam, 0x0106): code signature in (/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam) not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
Camera:

    FaceTime HD Camera (Built-in):

      Model ID: UVC Camera VendorID_1452 ProductID_34304
      Unique ID: 0x[redacted]8600

    HD Pro Webcam C920:

      Model ID: UVC Camera VendorID_1133 ProductID_2093
      Unique ID: 0x[redacted]082d

Hope this helps narrow it down, when this is working it's great!

spenserpothier avatar Apr 05 '20 00:04 spenserpothier

I have intermittent functionality after reboots, recompiles, etc

right now Im getting

$ system_profiler SPCameraDataType
2020-04-04 19:55:21.258 system_profiler[8078:40898] Error loading /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam:  dlopen(/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam, 0x0106): code signature in (/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam) not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
2020-04-04 19:55:21.258 system_profiler[8078:40898] Cannot find function pointer AppleCMIODPSampleVCamPlugIn for factory 35FDFF29-BFCF-4644-AB77-B759DE932ABE in CFBundle/CFPlugIn 0x7fa31722cbc0 </Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin> (bundle, not loaded)
Camera:

    FaceTime HD Camera:

      Model ID: Apple Camera VendorID_0x106B ProductID_0x1570
      Unique ID: …

cgudea avatar Apr 05 '20 02:04 cgudea

No Carbon Black, we do have other security tools installed that I can't disclose :) I'll try doing the build on my personal Mac.

Any other information I can provide to help?

ChrisWeiss avatar Apr 05 '20 17:04 ChrisWeiss

The inconsistency is super frustrating to me -- sometimes macOS allows it to run and sometimes it doesn't. I haven't been able to find a pattern.

I think this will be solved once we make a distribution package of this with a real production code signature. If anyone wants to help get a release infrastructure up and running here that'd be great!

For now, my hack above seems to be working ok when I get into this state where it won't run. To make/retrieve your codesigning identity

  1. Make sure you're logged into Xcode with your Apple ID (Xcode->Preferences->Accounts)
  2. security find-identity -v -p codesigning to see the available codesigning identities and the associated 40 character hex identifier.
  3. Change the CMakeLists.txt file for dal-plugin to use codesign --sign [your 40 char id] instead of codesign --sign -
diff --git a/src/dal-plugin/CMakeLists.txt b/src/dal-plugin/CMakeLists.txt
index c354f13c..a358bfc1 100644
--- a/src/dal-plugin/CMakeLists.txt
+++ b/src/dal-plugin/CMakeLists.txt
@@ -155,6 +155,6 @@ add_custom_command(TARGET dal-plugin

 add_custom_command(TARGET dal-plugin
        POST_BUILD
-       COMMAND /usr/bin/codesign --force --deep --sign - --timestamp=none ${TARGET_DIR}/obs-mac-virtualcam.plugin
+       COMMAND /usr/bin/codesign --force --deep --sign [my 40 char codesign identity] --timestamp=none ${TARGET_DIR}/obs-mac-virtualcam.plugin
        COMMENT "Codesign plugin"
 )

johnboiles avatar Apr 06 '20 03:04 johnboiles

Another data point here.

  • Catalina 10.15.4
  • Xcode 11.4
  • Homebrew other bits
  • No special security software
  • security fin... returns a valid identifier from xcode for my account
  • I get the same error whether I use ad-hoc (-) or my hex identifier

code signature in (/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam) not valid for use in process: mapping process is a platform binary, but mapped file is not

Rebooting and/or re-signing does not change this. No action/response needed, I'll keep following this issue on my own. Thanks for digging into this feature so quickly!

anoldguy avatar Apr 08 '20 15:04 anoldguy

@anoldguy Thanks for the data point! What software are you using to try to view the webcam stream? I think one part of this is that some software seems more sensitive than others

johnboiles avatar Apr 08 '20 15:04 johnboiles

Anything. PhotoBooth, Hangouts, Meet, Zoom, Whereby, Quicktime.

anoldguy avatar Apr 08 '20 20:04 anoldguy

Just one more piece of info, as of the latest update to zoom it is not working in either Mojave or Catalina.

Still showing up in quicktime and hangouts for me though.

spenserpothier avatar Apr 10 '20 02:04 spenserpothier

Could it be unable to run even if signed due to Library Validation? https://developer.apple.com/documentation/security/hardened_runtime https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation

Judging from https://nvd.nist.gov/vuln/detail/CVE-2020-11470, it appears that Zoom removed the entitlement in version 4.6.8, which could explain why it works for some people but not others.

~~I might try installing https://github.com/mologie/macos-disable-library-validation tomorrow in order to see if this is truly the issue.~~

Since installing the above requires disabling SIP, I just downgraded Zoom.us to 4.6.8. If any of you also want to do so for testing purposes, you can run brew cask install hkatzdev/cask-zoomus-vc/zoomus if you use Homebrew or just download it from https://zoom.us/client/4.6.19178.0323/Zoom.pkg. After downgrading, I was able to use the OBS Virtual Camera. Additionally, another app called CamTwist, which similarly stopped working in later versions of Zoom.us, started working again in the older version.

Therefore, I'm pretty sure it was to do with Library Validation. Unfortunately, I can't think of a good solution that doesn't involve disabling SIP unless Zoom signs the plugin, which would only fix it for Zoom.

hkatzdev avatar Apr 10 '20 07:04 hkatzdev

For Zoom at least, it is possible to get this to work by resigning it with the Disable Library Validation Entitlement. I signed the latest zoom with sudo codesign --entitlements entitlements.xml -f -s - /Applications/zoom.us.app and have not noticed any issues yet. Perhaps there could be a script that automates this for apps of your choosing?

Edit: Adding the Disable Library Validation Entitlement doesn't appear to be necessary, although if I had to guess that has to do with it not being signed with a certificate (although if zoom.us and the plugin were signed with the same certificate I believe it still wouldn't be necessary). This is definitely not optimal for security reasons but it works.

hkatzdev avatar Apr 10 '20 18:04 hkatzdev

@hkatzdev Thank you for all the info about library validation and the workarounds! The Snap Camera docs also talk about how Zoom 4.6.9+ are not supported.

So here are the codesigning issues we know about:

  • Some apps (Zoom, Slack) cannot any DAL plugins that are not signed with the same code signature as the application.
  • Adhoc codesigning (codesign --sign -) only sometimes works (Console.app shows mapped file has no Team ID and is not a platform binary in the console). This will probably cease to be an issue once we make production certificate codesigned releases.
  • System applications (Safari, FaceTime, PhotoBooth) cannot load DAL Plugins (Console.app shows not valid for use in process: mapping process is a platform binary, but mapped file is not) (reported by @anoldguy)
    • Why this happens: Seems to be a macOS security feature to prevent arbitrary code from loading in macOS.
    • Workaround: None so far. 3rd party webcams seem to work though. Is that because the driver for those comes from Apple (for UVC cameras). If we went deeper and emulated hardware could we make it work?

johnboiles avatar Apr 10 '20 18:04 johnboiles

@anoldguy can you double check that when using your own signing identity, and trying to open the source in QuickTime and Chrome you get the same not valid for use in process: mapping process is a platform binary, but mapped file is not message?

I want to make sure you didn't copy/paste that log from a system application (like Facetime) and got a different error from other applications (QuickTime, Chrome) that are working for some of us on Catalina.

johnboiles avatar Apr 10 '20 18:04 johnboiles

Clean built the project. Current state:

Quicktime: Works Browser based: Safari, no camera. Firefox, camera, but no video. OS (Facetime/Photobooth): No camera.

anoldguy avatar Apr 10 '20 19:04 anoldguy

@anoldguy and do you get that same platform binary error message when using QuickTime/Firefox? Or only for Safari/Facetime/Photobooth?

johnboiles avatar Apr 10 '20 19:04 johnboiles

Thank you all for the effort!! This helps a lot.

I confirm @hkatzdev's comment works for the latest zoom! For documentation sake, I wasn't familiar with PropertyLists, but I made it work having the below content for entitlements.xml

<?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>

yasushisakai avatar Apr 11 '20 01:04 yasushisakai

Thanks @yasushisakai and @hkatzdev this works fine for me and Zoom 4.6.10 (20041.0408)

jmb avatar Apr 11 '20 06:04 jmb

Yeah thanks @hkatzdev and @yasushisakai, your solution fixed it for me too, Zoom 4.6.10 on Catalina 10.15.3. I can access my Blackmagic capture device again from within Zoom. Cheers!

Jacob-Dyer avatar Apr 11 '20 12:04 Jacob-Dyer

This also allowed AWS Chime to see the virtual camera... I have an open ticket with that team about that problem. Thanks!

On Sat, Apr 11, 2020, at 8:50 AM, Jacob Dyer wrote:

Yeah thanks @hkatzdev https://github.com/hkatzdev and @yasushisakai https://github.com/yasushisakai, your solution fixed it for me too, Zoom 4.6.10 on Catalina 10.15.3. I can access my Blackmagic capture device again from within Zoom. Cheers!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/johnboiles/obs-mac-virtualcam/issues/4#issuecomment-612414059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATMTBANGQTMJELEVUCYPKLRMBRPVANCNFSM4L3C5TLA.

jimmydigital avatar Apr 11 '20 12:04 jimmydigital

Unfortunately, I made a mistake with the code I posted earlier. While resigning the code as I mentioned above works, it also completely removes the hardened runtime, which is not great for security. Instead, here is some very poorly written code that should do the following.

  1. Get the entitlements as xml
  2. Parse it using xml2
  3. Add the Disable Library Validation Entitlement to the list
  4. Turn it back into an xml file with 2xml and save it as an xml file
  5. Using the preserve-metadata option, attempt to change the least amount of things when resigning (including keeping hardened mode on if it was enabled before) while adding the new entitlement.

I tested the below command on Zoom.us, and now I have obs-mac-virtualcam working with Zoom.us's hardened mode enabled.

APPLICATION=/Applications/zoom.us.app && codesign -d --entitlements :- $APPLICATION | { xml2; echo "/plist/dict/key=com.apple.security.cs.disable-library-validation"; echo "/plist/dict/true"; } | 2xml > entitlements.xml && sudo codesign --sign - $APPLICATION --force --preserve-metadata=identifier,resource-rules,flags --entitlements=entitlements.xml && rm entitlements.xml

hkatzdev avatar Apr 12 '20 06:04 hkatzdev

Thanks again, I have reinstalled zoom and this works perfectly (I just had to use homebrew to install xml2).

jmb avatar Apr 12 '20 06:04 jmb

Am I correct in assuming manually resigning third party apps will likely cause issues with their update mechanism?

brinsche avatar Apr 12 '20 20:04 brinsche

Am I correct in assuming manually resigning third party apps will likely cause issues with their update mechanism?

It appears that for zoom.us (4.6.8-->4.6.10 at least) the app is replaced on an update, which just means that we would have to resign it again. Everything else seems to work. However, it would be a good idea to test with other apps to see if this does lead to a problem.

Also this is definitely not the optimal solution, since it reintroduces CVE-2020-11470. Unfortunately, I don't know of a better, more secure way.

hkatzdev avatar Apr 12 '20 21:04 hkatzdev