Aperture icon indicating copy to clipboard operation
Aperture copied to clipboard

Allow to choose window as source?

Open demian85 opened this issue 7 years ago • 7 comments

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.

demian85 avatar Dec 25 '16 20:12 demian85

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.

sindresorhus avatar Dec 25 '16 20:12 sindresorhus

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.

demian85 avatar Dec 26 '16 19:12 demian85

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 ☺️

matheuss avatar Jan 02 '17 13:01 matheuss

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

skllcrn avatar Jan 02 '17 13:01 skllcrn

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%

demian85 avatar Jan 02 '17 14:01 demian85

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!

skllcrn avatar Jan 02 '17 15:01 skllcrn

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

ldenoue avatar Dec 25 '22 09:12 ldenoue