Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to choose window as source? #16

Open
demian85 opened this issue Dec 25, 2016 · 7 comments
Open

Allow to choose window as source? #16

demian85 opened this issue Dec 25, 2016 · 7 comments

Comments

@demian85
Copy link

I've recently reported a bug in Electron regarding a serious low frame rate using desktopCapturer API: electron/electron#8278
Seems that this project will save my life, but since the app I'm working on needs to be able to choose any open window as a recording source and I did not find anything in the documentation, I wonder if this can be accomplished somehow.
Does this feature exist or are you planing to include it?

Thanks.

@sindresorhus
Copy link
Member

It's possible. We would need to find the wanted window, focus it, get its position & size and only record that. According to this it might be possible to record the window directly too. Not something we currently need for Kap, where this is used, but a good pull request would be welcomed.

@demian85
Copy link
Author

Great, but unfortunately I'm not very familiar with Swift. Will take a look at the code and see if I can do something.
Btw, I have 2 more questions:

  • Can I use webm format instead of mp4? Also not sure which codec is being used inside mp4 files.
  • What about the displayIdoption? Is that intended to work only as a monitor/screen source? If that's the case, how can I detect monitor ID in case there are more than one connected?

Thanks.

@matheuss
Copy link
Member

matheuss commented Jan 2, 2017

That's a pretty wanted feature ☺️ I still need to spend some time thinking and researching about it, but in addition of what @sindresorhus linked, I remember that I read somewhere that we can even do things like captureTheWholeScreen().minus(someWindow). 😮 ☺️

But yeah, I think this would be very useful – we want to provide something like macOS's Cmd+Shift+4 Space on Kap ☺️

@skllcrn
Copy link
Member

skllcrn commented Jan 2, 2017

To answer your additional questions; macOS assigns the display ID's, we do want to surface them via Aperture at some point though. Regarding capturing in different formats, Aperture simply bridges with AVFoundation. Kap uses ffmpeg to create MP4, GIF and WebM files.

I don't know what you're trying to achieve, but I believe this VS Code recorder uses Aperture to record a single window https://github.com/wk-j/vscode-screen-recorder/blob/f310941d0168001bca8790ab77337aecd7f3c96b/src/recorder.ts

@demian85
Copy link
Author

demian85 commented Jan 2, 2017

Still not sure if this library can help me.
I'm trying to record desktop and share video stream at the same time. Seems like mp4 streaming is not easy because moov atom headers are included at the end of the file.
By any chance, do you know how to fix that using AVFoundation?
Would need to go with ffmpeg and webm if that doesn't work.
Btw, tried ffmpeg & webm and cpu does not seem to go beyond 100%

@skllcrn
Copy link
Member

skllcrn commented Jan 2, 2017

This library has a limited scope and very specific feature set for the time being, see https://github.com/wulkano/aperture.js#why. Leaving this issue open for when we circle back to recording a specific window. Thank you!

@ldenoue
Copy link

ldenoue commented Dec 25, 2022

the new ScreenCaptureKit framework would let us do this.
see https://developer.apple.com/documentation/screencapturekit
I use it in my own app Screegle https://www.appblit.com/screegle

Laurent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants