title: Splitting webm video to png with transparency
body: <p>I need to split a <code>webm</code> encoded video into <code>png</code> frames, without losing transparency. I use the following ffmpeg command:</p>
  
  <pre><code>ffmpeg -i dancer1.webm -pix_fmt rgba frames/%04d.png
  </code></pre>
  
  <p>This produces a directory of pngs, but why is each output frame is missing transparency?</p>
  
  <p>I have used <a href="http://simpl.info/videoalpha/video/dancer1.webm" rel="noreferrer">this</a> example video, which contains an alpha channel. See it playing over a background <a href="http://simpl.info/videoalpha" rel="noreferrer">here</a>. Here's an example output frame from ffmpeg:</p>
  
  <p><img src="https://i.stack.imgur.com/bmR0D.png" alt="missing transparency?"></p>
  
  <p>ffmpeg produces the following output when it runs:</p>
  
  <pre><code>ffmpeg version N-60294-g549f052 Copyright (c) 2000-2014 the FFmpeg developers                                             [1/2471]
    built on Feb  2 2014 05:41:56 with gcc 4.6 (Debian 4.6.3-1)
    configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
    libavutil      52. 63.100 / 52. 63.100
    libavcodec     55. 49.101 / 55. 49.101
    libavformat    55. 28.101 / 55. 28.101
    libavdevice    55.  7.100 / 55.  7.100
    libavfilter     4.  1.101 /  4.  1.101
    libswscale      2.  5.101 /  2.  5.101
    libswresample   0. 17.104 /  0. 17.104
    libpostproc    52.  3.100 / 52.  3.100
  Input #0, matroska,webm, from 'dancer1.webm':
    Metadata:
      encoder         : libwebm-0.2.1.0
    Duration: 00:01:02.83, start: 0.000000, bitrate: 520 kb/s
      Stream #0:0(eng): Video: vp8, yuv420p, 640x360, SAR 1:1 DAR 16:9, 30 tbr, 1k tbn, 1k tbc (default)
      Metadata:
        alpha_mode      : 1
  Output #0, image2, to 'frames/%04d.png':
    Metadata:
      encoder         : Lavf55.28.101
      Stream #0:0(eng): Video: png, rgba, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 30 tbc (default)
  Metadata:
    alpha_mode      : 1
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (vp8 -&gt; png)
  </code></pre>
  
  <p>Running <code>identify</code> on an output png produces this:</p>
  
  <pre><code>$ identify 0001.png
  0001.png PNG 640x360 640x360+0+0 8-bit DirectClass 94.1KB 0.000u 0:00.000
  </code></pre>
  
  <p><code>file</code> has this to say about the png:</p>
  
  <pre><code>$ file 0001.png
  0001.png: PNG image data, 640 x 360, 8-bit/color RGBA, non-interlaced
  </code></pre>
  
  <p>Everything looks about right to me, so why don't the output images contain an alpha channel?</p>