C# - How to feed Ip camera stream from web url ? RRS feed

  • Question

  • I want to capture IP camera stream from url and want to show it in Image.

    I working on windows 8 pc and developing app using vs 2012.

    how can i do it in c#?


    Wednesday, November 27, 2013 8:09 AM

All replies

  • A easy way, you can use MediaElement to play to IP camera stream and using print screen API to get the image. But you can only do this in 8.1.

    Another way, you need to decode the stream to get the image. It needs lots of work in C++.

    Wednesday, November 27, 2013 9:00 AM
  • Hi Jesse,

    Thanks for your prompt reply.

    for now, i m using HttpClient feed camera stream

    HttpClient _client = new HttpClient();
                _client.Timeout = TimeSpan.FromMilliseconds(-1);

    HttpResponseMessage resultMessage = await _client.GetAsync(_url,HttpCompletionOption.ResponseHeadersRead);

    but its can not feed camera stream.

    I want this continuous sending http request to retrieve the frame so that it display like motion video. 

    Will you please suggest me another way through c# code ?


    • Edited by PavanModi Thursday, November 28, 2013 9:19 AM
    Wednesday, November 27, 2013 10:07 AM
  • Hi, Pavan

    You can use MJPEG Decoder library to capture Ip camera stream and decode it. Now this library is available for windows store app.

    See some codes and sample in the link below:


    Best Wishes!

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Edited by Anne Jing Friday, November 29, 2013 9:13 AM edit
    Friday, November 29, 2013 9:12 AM
  • Hi Anne,

    Thanks for your response to my question.

    I tried MjpegProcessor.winmd library with code give at below reference link.


    But still it's can not able to capture Ip camera stream and show it in Image. 

    Its continuously running thread like below output:

    'Zsecure.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Requests\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Requests.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    The thread '<No Name>' (0x1d5c) has exited with code 0 (0x0).
    The thread '<No Name>' (0x1848) has exited with code 0 (0x0).
    The thread '<No Name>' (0xe94) has exited with code 0 (0x0).
    The thread '<No Name>' (0x1594) has exited with code 0 (0x0).
    The thread '<No Name>' (0x1ad0) has exited with code 0 (0x0).

    Have you any more idea to capture stream ? 


    Monday, December 2, 2013 6:33 AM