I used to convert a stack of PNGs with alpha transparency using ffmpeg:
ffmpeg -i frame_%03d.png -vcodec png output.mov
I have an old mov
where this worked. Now I tried to do that again a while later (on an M1 Mac now). Now it doesn't work anymore. Here are the file properties:
property | old movie (works) | new movie (does not work) |
---|---|---|
resolution | 378 × 378 | 1600 × 1000 |
codec | Apple ProRes 4444 | PNG |
alpha channel | yes | ? |
color profile | SD (6-1-6) | ? |
software | Lavf57.41.100 | Lavf59.16.100 |
The ?
shows that I cannot open the new file in Quicktime, nor import it in Keynote. Any idea how I can use ffmpeg
to convert my image stack to a file with transparency that works in Keynote / Quicktime?
This page and experimenting helped me find a solution:
ffmpeg -i frame_%03d.png -c:v prores_ks -profile:v 5 -bits_per_mb 8000 -pix_fmt yuva422p10le output.mov
The key seems to be the a
in yuva444p10le
which enables an alpha channel and to use the profile 4
or 5
(didn't see a difference). Using the encoder prores
or prores_aw
also gave no alpha in my experiments.
Bonus: on a Mac, a right-click on the resulting file and selecting the video-encoding option opens a dialogue. Using one of the HEVC options and selecting the checkmark to keep transparency brings the file size way down (from 109 MB to 3 MB in my case).