Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
MJPEGStream NewFrame callback does not work on C#

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

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!