错误 补充信息。没有该类别的设备[英] error Additional information: No devices of the category

本文是小编为大家收集整理的关于错误 补充信息。没有该类别的设备的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

本文来自:IT宝库(https://www.itbaoku.cn)

我在项目中使用directx.capture和dshownet dll.我从笔记本电脑上正确地从视频设备(Windows 8)获得了视频流.我在另一台笔记本电脑(Windows 8.1)上尝试了它.

,但是当我在PC上执行它时会出现错误(Windows 8.1).

我在PC上安装了视频设备驱动程序,并通过其制造商的软件来工作,并显示视频流.但是它不适合我的代码.

我在以下行上的错误下方:

在directx.capture.dll

中发生了一个未经处理的例外.

附加信息:没有类别的设备

这是我的代码:

private void Form1_Shown(object sender, EventArgs e)
{
    filters = new Filters(); // error is on this line

    if (filters.VideoInputDevices != null)
    {
        try
        {
            preview(deviceNumber);
        }
        catch (Exception ex)
        {
            MessageBox.Show("Maybe any other software is already using your  WebCam.\n\n Error Message: \n\n" + ex.Message);
        }
    }

推荐答案

已经一年多了,但是我也有同样的问题.就我而言,我发现该错误起源于filters.cs

public FilterCollection AudioInputDevices = new FilterCollection( FilterCategory.AudioInputDevice ); 

那是因为我没有任何麦克风连接(音频输入设备),但事件尽管程序不使用它,因为它仅流式传输视频.一旦连接到一个,它就可以正常工作.希望它有帮助.

本文地址:https://www.itbaoku.cn/post/2353475.html

问题描述

I use DirectX.Capture and DShowNet dll in my project. I get video stream from a video device correctly on my laptop (Windows 8). I tried it on another laptop (Windows 8.1) and worked correctly too.

But I get an error when I execute it on my PC (Windows 8.1).

I install my video device driver true on PC and it works by it's manufacturer's software and shows video stream. But it doese not work with my code.

And I get below error on below line:

An unhandled exception of type 'System.NotSupportedException' occurred in DirectX.Capture.dll

Additional information: No devices of the category

Here's my code:

private void Form1_Shown(object sender, EventArgs e)
{
    filters = new Filters(); // error is on this line

    if (filters.VideoInputDevices != null)
    {
        try
        {
            preview(deviceNumber);
        }
        catch (Exception ex)
        {
            MessageBox.Show("Maybe any other software is already using your  WebCam.\n\n Error Message: \n\n" + ex.Message);
        }
    }

推荐答案

It's been over a year, but I had same problem. In my case I've found out that the error originates in Filters.cs at this point

public FilterCollection AudioInputDevices = new FilterCollection( FilterCategory.AudioInputDevice ); 

That was because I din't have any microphone connected (audio input device), event though the program doesn't use it, as it only streams video. Once connected one now it works properly. Hope it helps.