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

Feature Request: Record Border Shadow w/ Alpha Channel #1012

Open
nikhiljha opened this issue May 7, 2021 · 4 comments
Open

Feature Request: Record Border Shadow w/ Alpha Channel #1012

nikhiljha opened this issue May 7, 2021 · 4 comments

Comments

@nikhiljha
Copy link

macOS version: 11.3
Kap version: v3.3.2

Right now, if you take a screenshot with Command+Shift+4 (a MacOS feature, not a Kap feature), it saves the border shadow and makes the edges transparent. This looks really nice when embedded in a README or issue :)

Screen Shot 2021-05-07 at 3 22 37 PM

WebM files encoded in VP8 or VP9 (or APNG files, I believe?) w/ an Alpha channel have been supported in browsers for a while (Chrome 31).

Could Kap add an option to add transparent edges as well?

@sindresorhus
Copy link
Member

There's no easy way to record the windows with rounded borders and shadows. We can only record a rectangle of the screen. However, someone could potentially make a edit plugin that post-processes the video file to round the borders, add padding and shadow.

@nikhiljha
Copy link
Author

The edit service receives an mp4 file which is generated from the recording after trimming the duration and adjusting the size. It's expected to produce another mp4 file at the given output location, which will then be passed to the appropriate share service.

Hm, it looks like the edit service only supports input/output as mp4, which doesn't support transparency. So I guess the real feature would be to allow edit services to return formats that aren't mp4(?)

@sindresorhus
Copy link
Member

HEVC does support transparency.

@nikhiljha
Copy link
Author

ffmpeg -i input.mp4 -filter_complex "[0]geq=lum='p(X,Y)':a='if(gt(abs(W/2-X),W/2-18)*gt(abs(H/2-Y),H/2-18),if(lte(hypot(18-(W/2-abs(W/2-X)),18-(H/2-abs(H/2-Y))),18),255,0),255)'" -c:v libx265 output.mp4

This seems to work, modified from this StackOverflow post. I'll figure out how to make the edit service sometime later^TM

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

No branches or pull requests

3 participants