title: Fastest method for screen capturing on Linux
body: <p>This question is similar to this one</p>
  
  <p><a href="https://stackoverflow.com/questions/5069104/fastest-method-of-screen-capturing">Fastest method of screen capturing</a></p>
  
  <p>but for linux/X11. </p>
  
  <p>To be more specific, i need a method to capture the pixel images of one window (the programmatic equivalent of alt-print screen in windows) running on a X11 diplay.</p>
  
  <p>Notes and requirements: </p>
  
  <p>1) Even if a new window is placed on top of the window that is being captured, the pixel image should still point to the original application window without any occlusion </p>
  
  <p>2) it is not needed that the application window to be seen by the user, i just need to store the pixel buffers/images for video purposes</p>
  
  <p>other alternatives that i've explored are:</p>
  
  <p>1) xvfb - it works but it does does CPU rendering, which is slow and
  wasteful of a good GPU</p>
  
  <p>2) x11 inside many lxc - theoretically could work but is complex to
  setup, and i'm not sure it will scale well with many windows being
  captured</p>
  
  <p>suggestions and ideas are welcome</p>