rviscarra / webrtc-remote-screen

Stream a remote desktop screen directly to your browser
MIT License
466 stars 72 forks source link

Is it possible to support Windows? #1

Closed naikrovek closed 4 years ago

naikrovek commented 5 years ago

I would like to see support for sharing a monitor from Windows, if possible. Well, I know it's possible, I just don't know if it's possible using Go.

OBS can do what I want, but the latency is absolutely insane. I'm looking for more of a realtime solution, so I can show a group of people something on my screen while I talk to them on the phone using only a web browser on the viewing side, AND provide a very low latency viewing experience.

Assume that a valid HTTPS certificate is used on the web server of the Windows machine that shares it's screen.

rviscarra commented 5 years ago

I tried it on Windows, it crashes because of this. I'll see if I can debug a bit more and figure out what's going on.

ezoonet commented 5 years ago

it's cool

naikrovek commented 5 years ago

It's been a while - did you get anywhere? I'm hoping so.

it's almost certainly not a huge performance hit (and it is definitely not a problem for me) if you use a native x264 dll for Windows and call it like this: https://github.com/golang/go/wiki/WindowsDLLs

I don't know how much a native DLL and the x264 library differ in terms of API.

rviscarra commented 4 years ago

Hey @naikrovek, sorry it took a while to get back at you.

Unfortunately the DLL won't work since the x264-go library includes the sources of the x264 library it uses. The good news is that I added support for VP8 a few weeks ago so the x264 issue is no longer a blocker.

I don't think I'll be able to try VP8 on Windows for a couple of weeks but let me know if you do! :smile:

naikrovek commented 4 years ago

Compilation on Windows is not trivial for me for some reason. I can set up MinGW and MSYS fine but things just don't work. I hate C so much because of things like this.

naikrovek commented 4 years ago

Got it built - it took a few hours.

Does this only capture from an X server, or can it capture from Windows?

naikrovek commented 4 years ago

OK, I need to do more testing before I fire off comments to people I don't know.

It works on Windows with VP8.

image

Now, can you add HTTPS? 😃

rviscarra commented 4 years ago

It works on Windows with VP8

That's great news!

Now, can you add HTTPS?

I could add CLI flags to specify a cert. and a key but I don't see that being useful in general since you need to register a domain, generate a cert., expose a port if you're behind NAT, etc ...

If your use case is still the same I think ngrok or localtunnel can work for you, just keep in mind that if your share your session with multiple peers each WebRTC connection will spawn its own screen fetch / encode routines since it isn't optimized for that use case. :grin:

naikrovek commented 4 years ago

HTTPS is useful for me since WebRTC requires a secure connection. I'm using this software inside a corporate network and certs are not an issue.

Other available screen sharing applications here are either high latency or very low frame rate.

I'll see about adding HTTPS support since it doesn't fit the general use case.

Thank you for the help.