Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda