0

For RenPy it uses the notion of an Alpha Mask video https://www.renpy.org/doc/html/movie.html#movie-displayables-and-movie-sprites

I can convert the a bunch of PNGs with alpha channel to http://wiki.webmproject.org/howtos/convert-png-frames-to-webm-video I was wondering how to do the same sort of thing without creating another set of PNG files with just the alpha frame.

I'll be okay with something that uses imagemagik in the middle if needed.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

1

You can use ffmpeg to create both files at once.

ffmpeg -i img%d.png -filter_complex "alphaextract[a]" \
       -map   0:v -pix_fmt yuv420p -c:v libvpx -b:v 0 -crf 20 color.webm \
       -map "[a]" -pix_fmt yuv420p -c:v libvpx -b:v 0 -crf 20 alpha.webm

Depending on your shell, you may need to quote the map arg in single quotes.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • works well, I changed my approach in the end to build the in the mask side by side for the video to make it work with Ren'Py but what you have works well for the older assets – Archimedes Trajano Jun 17 '19 at 19:02