Convert transparent WebP video to HEVC MP4 with alpha channel
Converting the other direction is widely documented but going in the other direction required a little more digging. Here’s how I did it:
$ mkdir frames
$ ffmpeg -vcodec libvpx-vp9 -i INPUT_FILE.webm -pix_fmt rgba frames/%04d.png
$ ffmpeg -r 24 -i frames/%04d.png -c:v prores_ks -pix_fmt yuva444p10le OUTPUT.mov
That’ll give you a ProRes4444 version of it. To convert further, I used a macOS built-in service.
- Right-click on
OUTPUT.mov
- Select
Services > Encode Selected Video Files
- Select
HEVC 1080p
as the setting and checkPreseve Transparency
This should give you a OUTPUT-1.mov
which you can rename to .mp4
.
Using transparent video is easy and widely supported these days. Fun!