Problem C # Aforge VideoSourcePlayer does not show image

0

I have been trying to make the c # connection with the camera of the device (in this case laptop) using the AForge library and its components, the point set all the parameters with two buttons one to start and another to stop and a combobox that it shows me the video sources, and when I start the VideoSourcePlayer component of Aforge I only get connected .. and it never loads the image of the camera, although the light that indicates that the active camera on the laptop is on but in the Program does not show image, I leave the code and images

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
namespace Prueba_camara_Web
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private FilterInfoCollection dispositivos;
        private VideoCaptureDevice fuente;
        private void Form1_Load(object sender, EventArgs e)
        {
            dispositivos = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            foreach(FilterInfo x in dispositivos)
            {
                comboBox1.Items.Add(x.Name);
            }
            comboBox1.SelectedIndex = 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            fuente = new VideoCaptureDevice(dispositivos[comboBox1.SelectedIndex].MonikerString);
            videoSourcePlayer1.VideoSource = fuente;
            videoSourcePlayer1.Start();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            videoSourcePlayer1.SignalToStop();
            videoSourcePlayer1.Stop();
        }
    }
}

Thank you in advance for your help:)

    
asked by Brayan Guillen 19.12.2018 в 05:04
source

0 answers