BradyBrenot / huestacean

Philips Hue control app for desktop with screen syncing. C++ with Qt Quick GUI.
http://huestacean.com
Apache License 2.0
564 stars 54 forks source link

screen capture library #77

Open smasherprog opened 6 years ago

smasherprog commented 6 years ago

Just an FYI, the screen capture library will work on mac, linux and windows. I noticed that you were using a different library for mac. Is this other library faster than the screen capture lib? If so let me know and ill fix that asap

smasherprog commented 6 years ago

I do like the idea of trying to use the AVCaptureSession like you have done. Ill test that out and benchmark

BradyBrenot commented 6 years ago

Yeah I was planning to give that a shot on a Mac that wasn't on its death bed and getting some actual numbers before suggesting it to you, but then I never got around to it and 😴

I'm not sure how much better it is, but it seems to be a good deal lighter on my CPU. Still nowhere near as light as DXGI's duplication API on the same machine.

BradyBrenot commented 6 years ago

Looking back at my notes and testing it again, using CGDisplayCreateImage at high frame rate makes WindowServer spike to 90%+ CPU usage on my olde laptop (a 2007 Macbook Pro: Core 2 Duo T7700 / 8600M GT / ...), and the system's GUI is noticeably less responsive in general.

With AVCaptureSession on the other hand the app itself is only clocking around 25% CPU (which in Mac OS is per-core %), and WindowServer isn't wavering. Video playback in Chrome does get noticeably chunkier, I'm not sure if that's GPU-related or what's going on there; I don't see anything like it with DXGI duplication.

So yeah, at least from here it seems like a no-brainer. Should have let you know earlier.

smasherprog commented 6 years ago

Cool, I dont normally use mac on my day-to-day --just a mac mini for the odds and ends-- so I missed this library as an option for capturing. Ill implement this into the library this week.

smasherprog commented 6 years ago

Just made a release that includes the mac capturing by using AVcapturesession plus a.... bunch of other changes. Let me know how it goes......

BradyBrenot commented 6 years ago

I've been inactive the last couple weeks, hoping to get back into it this weekend, I'll check it out when I can.