smasherprog / screen_capture_lite

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

Support for signle window capture ? #29

Closed namkazt closed 6 years ago

namkazt commented 6 years ago

my next point in my app is single window capture. Any ideas how to achieve that ?

smasherprog commented 6 years ago

ill look into this.. On windows, I think its possible. But ill check this out over the weekened

smasherprog commented 6 years ago

as a fallback,, it would be possible to get the dimensions of the window and only capture that so it is possible

smasherprog commented 6 years ago

I am implementing Windows, Linux then mac.

Almost done with Windows now...

namkazt commented 6 years ago

great, thanks.

Best Regards.Mr. Nam NguyễnPhone No. : 012.9595.8685

Skype Account : nam.kazt

2017-08-06 5:35 GMT+07:00 Scott notifications@github.com:

I am implementing Windows, Linux then mac.

Almost done with Windows now...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smasherprog/screen_capture_lite/issues/29#issuecomment-320474141, or mute the thread https://github.com/notifications/unsubscribe-auth/AFwZzPd6E9XRPx2gwtdN9L2zQ-i9YR3Fks5sVO4ugaJpZM4Oucjv .

smasherprog commented 6 years ago

Windows should be done in master right now Working on the Linux code now.

smasherprog commented 6 years ago

Linux should be done and in master now too

namkazt commented 6 years ago

@smasherprog looking good man. I'm not test it yet but definitely today. Also i see you return a list of Windows on config functions. Is it capture a list of windows ?

smasherprog commented 6 years ago

yeah it will capture a list of windows.

smasherprog commented 6 years ago

theres likely still bugs, but I am trying to figure out each platforms details first.

namkazt commented 6 years ago

cool, i'm testing on old version there is some crash ( framegrabber ) but was use in release version so it just display critical error. Will put here if it happen one more time.

smasherprog commented 6 years ago

If you get a crash include as much information as possible.

I am working on the mac implementation now

smasherprog commented 6 years ago

The entire library is thread-safe. You do however need to Extract -- or copy-- any data out of the callback.

smasherprog commented 6 years ago

Mac is almost done It works when the desktop isnt scaled. I have to add checks for scaling and retina displays.

smasherprog commented 6 years ago

I havent completed the work on macs. It will work if there isnt any scaling, but I have to think about how I want to handle it in a way that makes sense and also is fast. Until then, windows and linux implementations should work fine.

smasherprog commented 6 years ago

If you want to jump in and do some Pull Requests they are welcome :)

namkazt commented 6 years ago

@smasherprog is there any way to directly set screen size in with this lib? I think capture lower resolution ( 640x480 for example ) is faster and also faster in encoding for my side.

smasherprog commented 6 years ago

https://github.com/smasherprog/screen_capture_lite/blob/master/Example/Screen_Capture_Example.cpp#L36

See my commented out code. It shows how to get just a 512x512 square. It doesnt have to be a power of two, but its best to stick with numbers that are powers of two because it will be a little faster.

What are you capturing that isnt fast enough? I have tested this on

low end mac mini -- I think i was able to hit 60 fps at 1080 linux virtualized -- over 200 fps windows over 60 fps as well.

I am away from my workstation right now, but the library should be pretty darn fast for most needs. If you post a link to your code I can take a look at it too..

namkazt commented 6 years ago

yeah but it still have to do in many thing in 1 frame like: 1, capture frame ( your lib ) example size: 1920x1024 2, resize to 400x240 3, get difference from old frame 4, send ...

so if i want to capture fullscreen but in 640x480 resolution (step 1 ) it will much more faster to do next steps.

but any way im just asking.

smasherprog commented 6 years ago

so, sure you can capture part of the monitor using the above code link.

smasherprog commented 6 years ago

Also, if you post your code, I can take a look and offer advise

namkazt commented 6 years ago

yeah. thanks. i will update after finish current version

Best Regards.Mr. Nam NguyễnPhone No. : 012.9595.8685

Skype Account : nam.kazt

2017-08-24 3:55 GMT+07:00 Scott notifications@github.com:

Also, if you post your code, I can take a look and offer advise

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smasherprog/screen_capture_lite/issues/29#issuecomment-324459720, or mute the thread https://github.com/notifications/unsubscribe-auth/AFwZzFEBy53AWKtDY0hIOL5h4tqGfcgRks5sbJHFgaJpZM4Oucjv .

smasherprog commented 6 years ago

Window capturing done for all platforms: win, linux and mac