title: Windows media foundation use raw image to encode video
body: <p>I'm working on a project that requires me to record webcam, microphone, and the screen.  I have webcam recording, <a href="https://stackoverflow.com/questions/12917256/windows-media-foundation-recording-audio/12917612">audio is a work in progress</a>, and I stumbled across <a href="http://www.codeguru.com/cpp/article.php/c18347/C-Programming-Easy-Screen-Capture-Using-MFCATL.htm" rel="nofollow noreferrer">CMonitor wrapper</a> (which I did some minor modifications to) to grab RGB images of the desktop on a specified monitor (if there are multiple monitors).</p>
  
  <p>How do I go about pushing my raw RGB frames into windows media foundation to encode into a video file?  My current video encoding is using a slightly modified version of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ee663604(v=vs.85).aspx" rel="nofollow noreferrer">this msdn sample</a>, if that's easier to modify than it is to write a new class handler.</p>
  
  <p>Or, perhaps there is some sort of media foundation route to recording the screen that I don't know of (which is possible, I'm not that great of a win32 programmer)?</p>