title: what is the as3 bitmapdata bytearray format / how to transform into png in python
body: <p>in a local as3 application i need to capture a video at 25 frames per second and send the bytearray to a local python script.
  when i try to encode the bytearray to png inside as3 it is much to slow.
  so i decided to just write the raw bytearray i got from :</p>
  
  <pre><code>var bitmapdata:BitmapData = new BitmapData(_videow,_videoh,false,0);
  bitmapdata.draw(_video);
  var ba:ByteArray=bitmapdata.getPixels(bitmapdata.rect);
  </code></pre>
  
  <p>this is pretty performant and does not drop frames so far.
  however, i need to convert these raw bytes to png on the python side.
  any idea how i can achieve that?</p>
  
  <p>thanks!</p>