I have a IP CAMERA
which it is a Raspberry PI
with Motion
installed. I want to get one frame when an event is triggered using C#
. The programming code in C# is as follows:
string sourceURL = "http://192.168.1.12:8081";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
req.Credentials = new NetworkCredential("username", "pass");
WebResponse resp = req.GetResponse();
using (Stream output = File.Create("some_image.jpeg"))
using (Stream input = resp.GetResponseStream())
{
input.CopyTo(output); //<-- the code stops here
}
Please, does anybody have an idea?