I'm trying to get stream from IP camera using the Aforge Libraries but it does not work correctly. NewFrameReceived is never called. Here is my code (Win10, VS2017, C#, .Net Framework 4.5):
private static MJPEGStream stream = new MJPEGStream();
public static int Play ( ... )
{
...
stream.NewFrame += new NewFrameEventHandler( NewFrameReceived );
stream.VideoSourceError += new VideoSourceErrorEventHandler( VideoSourceErrorReceived );
stream.Login = "admin";
stream.Password = "password";
stream.ForceBasicAuthentication = true;
stream.RequestTimeout = 10000;
stream.Source = "my uri";
stream.Start();
...
}
public static void VideoSourceErrorReceived ( object sender, VideoSourceErrorEventArgs eventArgs )
{
// Do something;
}
public static void NewFrameReceived ( object sender, NewFrameEventArgs eventArgs )
{
// Do something;
}
The video stream works because I try to get it from VLC and I can watch the live video from camera. VideoSourceErrorReceived also works (I have received some event from time to time) and no error appears in debug console.
Also, I have verified that the camera sends frames using Wireshark. After doing stream.Start(), messages start to arrive in Wireshark but these messages do not reach the callback.
Thanks in advance