If OBS is closed (or virtualcam is not started) when you open software that consumes the virtual webcam, then the 'OBS Virtual Camera' source does not show up. Usually this means you need to completely restart the software after you open OBS (and start the virtualcam output) for it to work.
This is especially annoying for apps like Chrome, since closing all open windows/tabs can be pretty disruptive.
To solve this we need to:
1) Adapt the plugin to not crash / shut down if it is unable to make a mach connection to OBS
2) Add code in the plugin to vend static frames to host software so that it appears as a real, working, video stream.
I've been thinking about cobbling some sort of a solution together, and just learned a lot of things in the past couple of hours... It's awesome to see how fast this project is coming together!
I had stumbled across this in week or so back, and figured it may be of relevance... Webcamoid's DAL virtual camera generates it's own test frame in code, then feeds it to this frame to the device stream whenever a valid frame is unavailable. While parts Webcamoid can be fairly crash prone, I've never experienced an issue with this functionality when I hammering it to try and make it do what I wanted:
As someone with zero experience with /(objective-)?C(\+\+)?/, I find some of the project's code a bit hard to grok, but the wrapper for DAL/IPC communication seems relatively comprehensive and clean, and _may_ provide some insight in allowing the plugin to inject it's own frame if need be? 馃し鈥嶁檪
Anyways, hope that helps, really looking forward to you collecting that bounty, this is a great project!
Thanks for the tip @andrewodri! I hadn't seen this before! The more examples of DAL virtual cameras, the better! Apple's documentation in this area is remarkably bad.
Do we have any OSS license gurus who could tell us if we can copy in code from webcamod's GPLv3 codebase into this project's GPLv2 codebase (and eventually OBS's GPLv2 codebase 馃)?
After burning a few hours trying to implement this inside of Apple's bad DAL sample code last Friday (which this project is based on), I'm inclined to just throw it all out if there's a better starting point we can find.
@johnboiles according to this spreadsheet by GNU we can't. But I'd be confused if we couldn't use it at all (that would seem weird since the licenses are very similar in most ways) and I'm gonna do some further research on this topic tomorrow.
No sweat @johnboiles! If you haven't looked too deep into this, there are a few issues and forks that might provide some insight/save some hair pulling:
There are issues logged for just about all of the challenges you're facing; random coding signing issues, keep-alive issues when server is gone, not-playing nice with other DAL plug-ins, etc.
I kind of figured licensing would be an issue; thanks for digging up that info @gxalpha! I guess the only real option is if the copyright holder would be willing to license it under GPLv2 as well... The copyright holder calls the shots. I vaguely remember reading something about GPLv3 assigning the copyright explicitly to the defined entities (in Webcamoid's case, one person), but GPLv2 includes all contributors... but don't quote me on that. This is why you license stuff that's supposed to be actually-free under MIT 馃槖
After looking through some of the code on previous occasions, not copying it is probably not the end of the world... As mentioned, I'm no C guy, but I know the difference between a pretty code and ugly code. I'd imagine this is more of a reference for a general approach, as well as a bit of a library on how to to overcome all of the common issues that are going to pop up with a DAL device.
I'll set up my environment to pull and build this thing too... One of my personal quarantine projects is to skill up in a low-level language like go or C. I have some bigger fish to fry at the moment, but if things continue, I'd love to get to the point where I can contribute to this!
I guess the only real option is if the copyright holder would be willing to license it under GPLv2 as well...
yes, thats what I found out as well. If we know which one we wanna use we could just ask them...
@andrewodri thank you for all your summaries and the informations. that's awesome.
I took a stab at re-implementing the DAL plugin part of the code by making the simplest implementation of a DAL plugin possible. I think that has more promise than trying to modify the Apple sample code. However I haven't been able to get it to work. I see it load in host applications like QuickTime but haven't had any luck getting it to expose a virtual camera. If anyone wants to try to see if they can find something I missed, it would be much appreciated!
https://github.com/johnboiles/coremediaio-dal-minimal-example
I'll take a look at it, not today tho. Maybe tomorrow or Monday or something like this
This should be fixed in master now that I've replaced the DAL code in #75
Most helpful comment
I've been thinking about cobbling some sort of a solution together, and just learned a lot of things in the past couple of hours... It's awesome to see how fast this project is coming together!
I had stumbled across this in week or so back, and figured it may be of relevance... Webcamoid's DAL virtual camera generates it's own test frame in code, then feeds it to this frame to the device stream whenever a valid frame is unavailable. While parts Webcamoid can be fairly crash prone, I've never experienced an issue with this functionality when I hammering it to try and make it do what I wanted:
https://github.com/webcamoid/webcamoid/blob/83c444fac2dcd36715ba38373d1fac0a3b8f690a/libAvKys/Plugins/VirtualCamera/src/cmio/VirtualCamera/src/stream.cpp#L249-L266
As someone with zero experience with
/(objective-)?C(\+\+)?/, I find some of the project's code a bit hard to grok, but the wrapper for DAL/IPC communication seems relatively comprehensive and clean, and _may_ provide some insight in allowing the plugin to inject it's own frame if need be? 馃し鈥嶁檪Anyways, hope that helps, really looking forward to you collecting that bounty, this is a great project!