Page 1 of 1

MJPEGStream for IP Camera

PostPosted: Sun Nov 11, 2018 9:50 pm
by MetalJim
I am trying to display an mpeg image in a picture box in Visual C#.
IT works when I use "×240"); but not when I use my camera address which is a trendnet camera.
Here is the code. Any idea why my trend net does not work ? If I type the source on a web browser an image pops up.

private void button1_Click(object sender, EventArgs e)
// create MJPEG video source
MJPEGStream stream = new MJPEGStream("");
// MJPEGStream stream = new MJPEGStream("×240"); //< This one works !
// set event handlers
stream.NewFrame += new NewFrameEventHandler(video_NewFrame);
// start the video source


private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)

Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();

// process the frame
pictureBox1.Image = bitmap;


Re: MJPEGStream for IP Camera

PostPosted: Mon Nov 12, 2018 7:57 am
by andrew.kirillov
MetalJim wrote:Any idea why my trend net does not work ?

Maybe it does not provide MJPEG stream. Maybe it is RTSP instead. Or maybe they have something custom in their MJPEG implementation. Try debugging and see what actually comes from that URL.

Re: MJPEGStream for IP Camera

PostPosted: Sat Nov 24, 2018 10:38 pm
by MetalJim
I had the same issue. My Trendnet camera and hikvision camera will only work with
JPEGStream stream = new JPEGStream("");
stream.NewFrame += new NewFrameEventHandler(video_NewFrame1);
//IF you have a password, you will also need to supply that information as well.
stream.Login = "admin";
stream.Password = "password";
//and then start