why RTSP Video url is showing no Video in my Picturebox in C#

264 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

0

There are 0 best solutions below