title: Record incoming mjpeg stream?
body: <p>I have a incoming mjpeg stream from an IP cam.
  Now I can show it using ffmpeg and openGL, but when I tried to save all the incoming streams into a file and play it later, the player(VLC) fails to open the file.</p>
  
  <p>I was told I need to add some header when I start/stop the recording to let the player know the file's format.
  But I could not find any reference on this topic.
  Could anyone share a example on this topic?</p>