title: Easiest way to get raw video/audio frames into an AVI (or other container)?
body: <p>I'm working on writing a small application using the <a href="http://wpfmediakit.codeplex.com/" rel="nofollow noreferrer">WPF MediaKit</a>, and I would like to record some video - my plan is, to store the last <em>n</em> seconds as raw audio/video frames, then write them out as an AVI when the user requests it.</p>
  
  <p>Is there an easy way to actually pipe the data I've gathered from the Webcam into an AVI file?  The trick is, I have to use buffered data, I can't directly just write a new DirectShow scene graph to write out the AVI file - for my app, the camera is running all the time, and the user signals the <em>end</em> of the capture (and we take the last few seconds or so).</p>
  
  <p>The AVI doesn't have to be compressed in any way, I'm going to run it through Expression Encoder to do that. Any ideas?</p>