user33422: I have a set of 300 transparent png files and I would like to create a transparent video file from them. I'm using the ffmpeg command as follows:
ffmpeg -f image2 -i anim.%04d.png -r 30 -vcodec png video.webm

I know webm has an alpha channel according to this answer. The command creates the video but the transparency is completely lost. What am I doing wrong? Is it possible to create a transparent .mp4 with ffmpeg?

user1950: You have to specify the pixel format, to force it to include the alpha channel, using the -pix_fmt option. You don't need to use png as your video codec either.
ffmpeg -i anim.%04d.png -r 30  -pix_fmt yuva420p video.webm


33422: <p>I have a set of 300 transparent png files and I would like to create a transparent video file from them. I'm using the ffmpeg command as follows:</p>
<pre><code>ffmpeg -f image2 -i anim.%04d.png -r 30 -vcodec png video.webm
</code></pre>
<p>I know webm has an alpha channel according to <a href="https://video.stackexchange.com/questions/23893/make-white-background-in-mp4-movie-transparent">this answer</a>. The command creates the video but the transparency is completely lost. What am I doing wrong? Is it possible to create a transparent .mp4 with ffmpeg?</p>
 1950: <p>You have to specify the pixel format, to force it to include the alpha channel, using the <a href="https://ffmpeg.org/ffmpeg.html#Advanced-Video-options" rel="nofollow noreferrer"><code>-pix_fmt</code> option</a>. You don't need to use png as your video codec either.</p>
<pre><code>ffmpeg -i anim.%04d.png -r 30  -pix_fmt yuva420p video.webm
</code></pre>
