简体   繁体   English

如何从WIA相机获取视频?

[英]How do I get an VIDEO from a WIA camera?

I'm developing small app in C# 3.5 for Windows XP that will automatically download images and video from a camera to a PC, on camera plug-in via USB. 我正在开发用于Windows XP的C#3.5小应用程序,它将通过USB自动将图像和视频从相机下载到PC,通过相机插件。 I have a Canon ixus 50 camera and I figure out how to get images from that camera to the PC, but I just can't figure out how to get/download AVI format videos. 我有一台佳能ixus 50相机,我弄清楚如何从相机到PC获取图像,但我无法弄清楚如何获取/下载AVI格式的视频。 Can someone help me please? 有人能帮助我吗? It's true that I'm using WIA 2.0, but it seems to be working for now. 确实,我正在使用WIA 2.0,但它似乎现在正在运行。 :) :)

I have never ever managed to get WIA properly working. 我从来没有设法让WIA正常工作。

Sometimes it worked almost fine for photos but there was no video. 有时它对照片几乎没有效果,但没有视频。 Some other times it would never work on my customers' PCs (same camera, same PC specs). 有时候它永远不会在我的客户的PC上工作(相同的相机,相同的PC规格)。

Finally I completely gave WIA up and managed to create my custom control based on DirectX. 最后,我完全放弃了WIA并设法创建基于DirectX的自定义控件。

What I've found 我发现了什么

  1. Using Expression SDK to get image/video: http://www.codeproject.com/Articles/202464/How-to-use-a-WebCam-in-C-with-the-NET-Framework-4 使用Expression SDK获取图像/视频: http//www.codeproject.com/Articles/202464/How-to-use-a-WebCam-in-C-with-the-NET-Framework-4
  2. DirectShow: http://www.codeproject.com/Articles/18511/Webcam-using-DirectShow-NET . DirectShow: http//www.codeproject.com/Articles/18511/Webcam-using-DirectShow-NET
  3. DirectX Capture (AVI): http://www.codeproject.com/Articles/3566/DirectX-Capture-Class-Library . DirectX Capture(AVI): http//www.codeproject.com/Articles/3566/DirectX-Capture-Class-Library

Keep in mind 记住

  1. It's really easy to work with. 这很容易合作。 Requires some Expression (SDK) DLL and for that it will work only in x86 and you will have to set your app from AnyCPU or x64 to x86. 需要一些Expression(SDK)DLL,为此它只能在x86中工作,你必须将你的应用程序从AnyCPU或x64设置为x86。 Period. 期。

  2. Works really fine but this is more to static pics. 工作得很好,但这更多的是静态图片。

  3. Never tested but looks really close to your needs. 从未测试,但看起来非常接近您的需求。 Can't say if it works but I'll go that way for testing, at least. 不能说它是否有效,但至少我将采用这种方式进行测试。

My thoughts 我的想法

WIA is rather simple and easy. WIA相当简单易行。 I've used it on Delphi and Clarion software (both are native Win32). 我在Delphi和Clarion软件上使用它(两者都是原生的Win32)。 It's somewhat fine but nowadays WIA is not the way to go. 这有点好,但现在WIA不是那样的。

Many webcams simply won't work with WIA and you'll have to tell your customers to change their webcam to a strangly-named chinese/korean/wtf brand just to keep your app working. 许多网络摄像头根本无法与WIA配合使用,您必须告诉您的客户将其网络摄像头更改为一个扼要命名的中国/韩国/ wtf品牌,以保持您的应用正常运行。

Try the last option. 尝试最后一个选项。 At least, download and run the code. 至少,下载并运行代码。

Hope it helps. 希望能帮助到你。

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

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