Archimedes Trajano
Archimedes Trajano

Reputation: 41790

Make an Alpha Mask video from PNG files

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.

Upvotes: 0

Views: 2983

Answers (1)

Gyan
Gyan

Reputation: 93379

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.

Upvotes: 2

Related Questions