title: Custom avi/MP4 file writer
body: <p>I am writing some video files under Windows from a camera.<br>
  I need the data unaltered - not MP4's 'uncompressed' ie. no YUV, no color interpolation - just the raw camera sensor bytestream.</p>
  
  <p>At the moment I am writing this direct to disk and re-reading it later to recode into a usable video. But with no header I have to keep track of image size, frame rate, color balance etc separately.</p>
  
  <p>I could add a custom header but even if the actual video data is unreadable by anything other than my app, using an AVI file would at least give me a relatively standard header to store all the camera parameters and also means that resolution, length etc would show up in explorer.</p>
  
  <p>Is there an easy way of generating an AVI header/footer without sending all the data through directshow or vfw?  The data is coming in at >250MB/s and I can't lose any frames so I don't have time to do much more than dump each frame to disk.</p>
  
  <p>edit: Perhaps MP4 would be better I have a lot of metadata about the camera config that isn't in the AVI standard  </p>