I would like to use avconv
to convert a series of PNG images to a WebM video, preserving transparency.
I understand that the pixel format used in the output video must support transparency. So I tried:
$ avconv -framerate 25 -f image2 -i frames/%03d.png -pix_fmt yuva420p output.webm
Unfortunately, avconv
complains:
Incompatible pixel format 'yuva420p' for codec 'libvpx-vp9', auto-selecting format 'yuv420p'
I am using ffmpeg version 2.8.4-1+b1 Copyright (c) 2000-2015 the FFmpeg developers
.
With VP8:
ffmpeg -framerate 25 -f image2 -i frames/%03d.png -c:v libvpx -pix_fmt yuva420p output.webm
Edit: Now, with VP9
ffmpeg -framerate 25 -f image2 -i frames/%03d.png -c:v libvpx-vp9 -pix_fmt yuva420p output.webm
Since 2016-07-13, it's possible to encode VP9/webm videos with alpha channel (VP9a).
You only need a copy of ffmpeg compiled after that date. By the way, all you need to write is:
ffmpeg -i frames/%03d.png output.webm
FFmpeg understands png format and will set a default framerate of 25 fps and a yuva420p
pixel format to the output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With