简体   繁体   English

如何在其他计算机上运行DirectShow.net应用程序

[英]How to go about running DirectShow.net application on other computers

I have a C# DirectShow.Net application and i want to test it running on other computers in release mode. 我有一个C#DirectShow.Net应用程序,我想测试它在发布模式下在其他计算机上运行。 How can i go about making sure my program will run on other machines that don't incorporate the windows sdk and the filters it avails? 我如何确保我的程序将运行在其他没有包含Windows sdk的机器上以及它所使用的过滤器?

I will have to include the dirctshow dlls and such but what can i do about the filters themselves? 我将不得不包括dirctshow dlls等,但我可以对滤镜本身做些什么呢?

Update: I have virtual machines to run it on, but moreover how can i make sure a certain directx filter is on a computer and if it isnt, grab the dll and register it to the computer from code? 更新:我有虚拟机来运行它,但是我怎样才能确保计算机上有某个directx过滤器,如果不是,请抓住dll并从代码中将其注册到计算机?

Edit: After i have the DLLs registered i run my program. 编辑:我注册了DLL后运行我的程序。 It doesnt run, so i grab graphstudio and i attach my program's graphs to graphstudio and none of the filters are connected and when i try to manually connect them they refuse to connect. 它没有运行,所以我抓住graphstudio并将我的程序图形附加到graphstudio并且没有连接过滤器,当我尝试手动连接它们时它们拒绝连接。

Edit2: EDIT2:

Can you post more details about the scenario you are having problems with? 

I am running my application which works on my windows 7 32bit machine on my Virtualbox VM. 我正在运行我的应用程序,它可以在我的Virtualbox VM上的Windows 7 32位机器上运行。 the virtualbox wont allow me access to my usb device for streaming purposes so i commented out the code that depends on it. 虚拟机不允许我访问我的USB设备用于流式传输,所以我注释掉了依赖它的代码。 when i run it, the filters wont connect. 当我运行它时,过滤器不会连接。 I did some testing and tried to recreate the graphs without the source and they wont connect together so that may actually be the problem. 我做了一些测试,并试图重新创建没有源的图形,他们不会连接在一起,所以这可能实际上是问题。

OS version? 

At the moment i am running the 32bit XP virtualbox VM 目前我正在运行32位XP虚拟机VM

which filters you are using? 

I am using 我在用

Source -> Smart tee (capture) -> GMFBridgeSinkFilter
          Smart tee (preview) -> AVI Decompressor -> Video REnderer

GMFBridgeSource -> ffdshow video encoder -> avi mux -> File writer

(w)riter has to be lowercase for some odd reason. (w)由于一些奇怪的原因,riter必须是小写的。 dev machine has (w)riter and (W)riter 开发机具有(w)riter和(W)riter

Which filters do you have there that you are not using? 

Do you mean which are standard on the OS or filters i put in the code and am not connecting to? 你的意思是操作系统上的标准或我在代码中放入的过滤器并没有连接到?

You could also try with the original GraphEdit instead of GraphStudio, and you could debug your application remotely and see where it is failing exactly.

Graphedit only comes in the full windows sdk which is a pain to download where im at. Graphedit只出现在完整的windows sdk中,这是一个很难下载的地方。

Here is a list of a few verifications that you could do: 以下是您可以执行的一些验证的列表:

  • As @HiperiX stated, it is a good idea to test your application in a clean system, maybe using some virtualization software. 正如@HiperiX所说,最好在干净的系统中测试你的应用程序,也许使用一些虚拟化软件。 If you need to support Win XP, it will be a good idea to test it there too, since there are a few DirectShow filters that are only available in Win Vista and later. 如果你需要支持Win XP,那么在那里进行测试也是一个好主意,因为有一些DirectShow过滤器仅在Win Vista及更高版本中可用。
  • About the required filters, some of them might be provided by Windows. 关于所需的过滤器,其中一些可能由Windows提供。 Those that are not, you must provide them and register them in the target system during the installation process of your application. 那些不是,你必须提供它们并在应用程序的安装过程中在目标系统中注册它们。 I would recommend in this case creating an installation project from visual studio and attach all your dependencies dlls there. 在这种情况下,我建议从visual studio创建一个安装项目,并在那里附加所有依赖项dll。 For a manual installation you can copy your filters to your application's folder and register them using regsvr32 filtername.ax from command line. 对于手动安装,您可以将过滤器复制到应用程序的文件夹,并使用命令行中的regsvr32 filtername.ax注册。
  • One more detail you will need to take care of is compatibility with 64 bits versions of Windows, since you cannot use filters built for 32bit native mode from a 64 bit applications. 您需要注意的另一个细节是与64位版本的Windows的兼容性,因为您不能使用64位应用程序为32位本机模式构建的过滤器。 If your application was developped in .net and it was built using AnyCPU mode, the .net JIT will create 64 bit code from it and your 32 bit dlls will fail to load. 如果您的应用程序是在.net中开发的,并且它是使用AnyCPU模式构建的,则.net JIT将从中创建64位代码,并且您的32位dll将无法加载。 So if you are using 32 bits dlls I would recommend building your .net application with CPU Type = X86. 因此,如果您使用的是32位dll,我建议您使用CPU Type = X86构建.net应用程序。 You can set this mode in your project configuration in Visual Studio. 您可以在Visual Studio中的项目配置中设置此模式。
  • Depending on how your filters were created, you may also need to install Visual c++ redistributable files . 根据您的过滤器的创建方式,您可能还需要安装Visual c + +可再发行文件
  • About this remark: 关于这句话:

I did some testing and tried to recreate the graphs without the source and they wont connect together 我做了一些测试,并试图重新创建没有源的图形,他们不会连接在一起

That is certainly a problem, you cannot create a graph without a source filter AND a destination filter. 这肯定是个问题,如果没有源过滤器和目标过滤器,则无法创建图形。 The source filter will in general determine the content format, compression, color space etc, etc. In order to test this application with a virtual system you need to provide direct access to your USB ports inside the virtualized OS and install the drivers for your capture devices there, as in a real system. 源过滤器通常会确定内容格式,压缩,颜色空间等。为了使用虚拟系统测试此应用程序,您需要提供对虚拟化操作系统内USB端口的直接访问,并安装捕获的驱动程序那里的设备,如在真实系统中。 Otherwise DirectShow will not detect your device(s). 否则DirectShow将无法检测到您的设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM