smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
616 stars 156 forks source link

IOS onFrameChanged always triggers in createwindowgrabber() example #74

Open friksa opened 4 years ago

friksa commented 4 years ago

Even when there are no changes in a window, onFrameChanged triggers for every capture frame. This is not an issue when capturing the entire monitor with createframegrabber().

Tried with different windows, but getting the same results. On OS X Catalina.

PS: Thanks for an awesome project!

smasherprog commented 4 years ago

It will take me a few days to take a look at this as I havent even started my mac up in about 5 months so i have to update everything ...

smasherprog commented 4 years ago

I no longer have a mac to fix this. I know the images returned by the OS callback might differ slightly.. If you can issue a PR on this, or provide more info that would be awesome

EMCP commented 2 years ago

the title says iOS, do we mean MacOS ? any way I can help ? I can confirm the behavior is occurring on my Mac Mini Intel 2020

smasherprog commented 2 years ago

If you can figure it out.
My guess is that the images are slightly different each frame I am unsure what needs to be done to fix this. My thoughts: are the changes between images like red is 100 and 101 in another. If thats the case, then some variance can be added to the code. Maybe getting the difference for windows on mac is just something that isnt do able in which case the function should have no effect on mac..

I am not sure what path needs to be taken, but ... Give it a shot!

EMCP commented 2 years ago

Once I have my basic setup maybe I can jump into the sensitivity settings. the first thing I need to work on is figuring out the color shifting.. im trying to push these frames to a remove machine to run inference.. and thinking it best I first get the colors as needed before transmitting them

image

there's probably some way to make it tunable, sort of like how some webcams offer a sensitivity rating

smasherprog commented 2 years ago

Did you test saving image to disk as the example does? If the image looks fine there, then its something in the way you are displaying the colors, for example you could be swapping the R abd B

EMCP commented 2 years ago

I'll stop stealing this thread, and maybe open up a PR if I can get the colors right.. but basically on OSX I just uncommented and run the code.. open it in the default Mac Preview App..

so maybe for mac OS I gotta just do something special with the color order, as you stated.