title: How to capture an ip camera (mjpeg) stream and replay it later via commandline?
body: <p>To test a software which processes ip camera streams (eg. mjpeg) I would like to capture a short sequence from an original camera and later stream this recording in loop as if it would come from an ip camera. It should be commandline based to simplify automated integration testing.</p>
  
  <p>I already figured out the recording part (capturing 10 seconds):</p>
  
  <pre><code>$ vlc -I dummy --run-time=10 http://192.168.0.142:8080/videofeed  --sout=file/asf:test-stream.asf vlc://quit
  </code></pre>
  
  <p>How to use vlc or similar to loop this recording as a mjpeg stream served on <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> or similar? </p>