Search code examples
videoffmpegwebmavconv

Convert PNGs to webm video with transparency


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.


Solution

  • 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