Kap icon indicating copy to clipboard operation
Kap copied to clipboard

Feature Request: Record Border Shadow w/ Alpha Channel

Open nikhiljha opened this issue 4 years ago • 4 comments

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?

nikhiljha avatar May 07 '21 22:05 nikhiljha

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.

sindresorhus avatar May 08 '21 05:05 sindresorhus

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(?)

nikhiljha avatar May 08 '21 05:05 nikhiljha

HEVC does support transparency.

sindresorhus avatar May 08 '21 06:05 sindresorhus

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

nikhiljha avatar May 08 '21 20:05 nikhiljha