I have a problem when I try to capture high resolution images with this webcam (https://www.logitech.com/en-gb/product/brio?crid=1690)
I use the following code (C#):
- Code: Select all
FilterInfoCollection videosources = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (videosources != null)
{
videoSource = new VideoCaptureDevice(videosources[1].MonikerString);
try
{
if (videoSource.VideoCapabilities.Length > 0)
{
string highestSolution = "0;0";
for (int i = 0; i < videoSource.VideoCapabilities.Length; i++)
{
if (videoSource.VideoCapabilities[i].FrameSize.Width > Convert.ToInt32(highestSolution.Split(';')[0]))
highestSolution = videoSource.VideoCapabilities[i].FrameSize.Width.ToString() + ";" + i.ToString();
}
videoSource.VideoResolution = videoSource.VideoCapabilities[Convert.ToInt32(highestSolution.Split(';')[1])];
}
} catch (Exception ex) { Console.WriteLine(ex.StackTrace); }
videoSource.NewFrame += new AForge.Video.NewFrameEventHandler(videoSource_NewFrame);
videoSource.Start();
}
and
- Code: Select all
void videoSource_NewFrame(object sender, AForge.Video.NewFrameEventArgs eventArgs)
{
pictureBoxVideo.Image = (Bitmap)eventArgs.Frame.Clone();
}
It works fine for resolutions up to 800x448. (LED on the webcam is on and i see a picture in my application).
For resolutions above (e.g. 800x600) the LED is off and i dont get a picture.
Any help is appreciated. Greetings from Germany.