johnboiles / 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.
GNU General Public License v2.0
4.06k stars 160 forks source link

Use `OBSDALCMSampleBufferCreateFromDataNoCopy` to eliminate a framebuffer memory copy #259

Open johnboiles opened 3 years ago

johnboiles commented 3 years ago

We could potentially improve performance by using OBSDALCMSampleBufferCreateFromDataNoCopy instead of OBSDALCMSampleBufferCreateFromData which should remove a memory copy of the framebuffer, saving a bit of performance and latency transferring the frames from OBS to the virtual camera.

When I tried this, it seemed to work just fine when using the OBS Virtual Camera device in other programs. But when using the plugin as a source in OBS (looping back the output of OBS), it didn't work. Strangely when I'd set the source to a lower resolution than the output it would work for some reason. This made me worried that using OBSDALCMSampleBufferCreateFromDataNoCopy could cause problems in some programs. I'm really not sure why this is, but it's possible this is a bug in OBS, and in fact this plugin would be just fine eliminating this memory copy. More investigation is needed.