Make an Alpha Mask video from PNG files

北慕城南 提交于 2020-01-16 18:49:31

问题


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.


回答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.



来源:https://stackoverflow.com/questions/56606472/make-an-alpha-mask-video-from-png-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!