stweil / OSXvnc

VNC Server for macOS
GNU General Public License v3.0
198 stars 64 forks source link

Use avfoundation to capture screen #25

Open newperson1746 opened 6 years ago

newperson1746 commented 6 years ago

I noticed that using OSXvnc on a gigabit local network is much slower in terms of update speed vs the default screen sharing (in VNC compatibility mode.) FFmpeg uses avfoundation to capture the screen at full refresh rate via rgba, and it works great. This is an enhancement that I just noticed. OSXvnc calls GL methods directly to get the screen (I think) which is slower.

I use OSXvnc since it supports so many more display modes than the default screensharing. This is especially true when using a non-mac os to remote into a macOS host. Since Screen Sharing supports the apple adaptive codec, it is super smooth. On linux, VNC supports many more modes than default screen sharing doesn't. The speed increase by using ZRLE, i.e is negated if the capture method for the screen is slower than the default screen sharing in VNC backward compatibility mode. I just suggest using avfoundation for a massive increase in capture speed.

stweil commented 6 years ago

Thank you for this hint. Do you know whether libvncserver is faster, too (maybe by using avfoundation)? I consider using that library, see issue #5.

Send me a pull request if you have new better code with avfoundation.

mykola-mokhnach commented 5 years ago

@stweil Can you please review https://github.com/saucelabs/OSXvnc/pull/1 ? I would be happy to push this improvement back to the origin if you'd like it.

stweil commented 5 years ago

Pull requests are welcome, but I prefer to get small commit sets which are much easier to review for me. You would also have to fix the header comments in the new files to include a GPL compatible license statement ("All rights reserved" is incompatible).