why RTSP Video url is showing no Video in my Picturebox

359 Views Asked by At

I'm trying to implement RTSP url for live view of camera with AForge.Video.DirectShow;

here's my code

private VideoCaptureDevice videoSource;
        public camtest3()
        {
            InitializeComponent();
        }

        private void camtest3_Load(object sender, EventArgs e)
        {
            // Create a new instance of the VideoCaptureDevice class using the RTSP URL
            videoSource = new VideoCaptureDevice("rtsp://IP:554/av0_1");

            // Register the NewFrame event handler to capture each new video frame
            videoSource.NewFrame += new NewFrameEventHandler(VideoCaptureDevice_NewFrame);

            // Start capturing video
            videoSource.Start();
        }

        private void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            // Display the video frame in a picture box control named pictureBox1
            pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();
        }

while using breakpoints i noticed that the call is never going to pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();

i have installed the below libraries enter image description here

The code is working without any Error but no Video displayed

1

There are 1 best solutions below

0
Julian Galeano On

You should use different component, I use VLC, just install it on your PC, goto 2 Toolbox, include in your project, drag & drop and by code include the URI address.