Extract Jpg from Mjpeg
<p>Trying to extract jpg from Mjpeg which return from an Axis IPCam. </p>

<p>From the document, Axis IPCam will return HttpResponse which contain the Mjpeg.</p>

<p>Here , I use this code and I have no idea to proceed futher.</p>

<pre><code>HttpWebRequest webrequest = null;
HttpWebResponse webresponse = null;  
webrequest = (HttpWebRequest)WebRequest.Create(uri);
webresponse = (HttpWebResponse)webrequest.GetResponse();

StreamReader sr = new StreamReader(
    webresponse.GetResponseStream().Encoding.ASCII);
string result = sr.ReadToEnd();
</code></pre>

<p>The Mjpeg in the HttpResponse will look like tis:</p>

<pre><code>--myboundary
Content-Type: image/jpeg
Content-Length: 3159
(BINARY)  &lt;-----------This is Jpeg 
--myboundary

Content-Type: image/jpeg
Content-Length: 3162
(BINARY)
--myboundary
Content-Type: image/jpeg
Content-Length: 3151
(BINARY)
</code></pre>

<p>Question:</p>

<ol>
<li><p>Can I  use Encoding.Ascii for the for the return Httpresponse Stream? This way all the byte will in string form ?</p></li>
<li><p>From (1), How do I get the (binary out) by parsing?</p></li>
</ol>

<p>I hope I can get all the help I can get here.</p>

<p>Thanks</p>
