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.
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. Can someone help me please?
It's true that I'm using WIA 2.0, but it seems to be working for now. :)
I have never ever managed to get WIA properly working.
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).
Finally I completely gave WIA up and managed to create my custom control based on DirectX.
What I've found
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
DirectShow: http://www.codeproject.com/Articles/18511/Webcam-using-DirectShow-NET.
DirectX Capture (AVI): http://www.codeproject.com/Articles/3566/DirectX-Capture-Class-Library.
Keep in mind
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. Period.
Works really fine but this is more to static pics.
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. I've used it on Delphi and Clarion software (both are native Win32). It's somewhat fine but nowadays WIA is not the way to go.
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.
Try the last option. At least, download and run the code.
Hope it helps.
Related
Hopefully someone can point me in the right direction. After spending many hours fighting this I am at my wits end. At this point I am just trying to get the EMGU example applications to run.
Just the facts ...
Applications hang at the line "_capture = new VideoCapture();"
All other versions of EMU were uninstalled
I am using the latest version of EMGU (3.2.0.2682)
No error message or exceptions are displayed
I am using a webcam, logitech C615
Camera works with logitech software
Using a coworker's computer the camera worked after a fresh install of EMGU
Any example program that uses VideoCapture also just hangs the app
The app I am focusing on is C:\Emgu\emgucv-windesktop 3.2.0.2682\bin\Example.CameraCapture.exe
Attaching a debugger provided no useful information
Once the applications are started the only way to kill them is to restart the pc
Other EMGU applications like faceDetection work just fine
List of running processes
I have a feeling it has something to do with a driver conflict, a library issue, or camera format issue. Any suggestions on how to troubleshoot this?
Turns out it was a conflict with a black magic video recorder device. I removed the card from the PC and everything started working. What a headache ...
NickJ, if there is a driver conflict it is not in EmguCV. Emgu CV includes no driver or drivers that might cause conflicts with a Camera. It only use existing drivers through OpenCV, which uses platform drivers to read camera stream or video files.
I long ago quit using EmguCV/OpenCv to handle my video capture. I found that these SDKs performed wonderfully at computer vision application and less wonderfully at capture.
I know people use them for capture and some have success but judging by the number of posts on SO asking about video capture I would suggest most have issues.
As for your specific problem I would be wondering how so many copies are getting started. You could download OpenCV, build it and debug through the code to see what is going on.
Doug
Windows Sound mixer/settings can set the microphone to play over the speakers. I'm looking for a way to do that through C#. I'm assuming there is a DLL reference or .NET call that might be able to.
Everything I've been finding invariably goes back to streaming, which I don't want to do. Unless that's whats actually happening under the hood when changing the audio settings in windows.
If it helps, I'm using C# 3.5 (Unity App) and running on Windows 10 latest.
Thanks!
You can do this with Core Audio APIs link
For implementation you can refer
https://blog.sverrirs.com/2016/02/windows-coreaudio-api-in-c.html
Having searched high and low for native c# hook to webcam, I found 5 basic ways to interact with the camera.
Video for Windows (VFW)
DirectX
avicap32.dll
WIA
3rd party tools
My requirement is to take a photo. The application will be used on some legacy windows XP and Vista machines, but going forward Windows 7 and greater will be required. So what might the best approach be with the broad install base? Just reading WIA looked like the way to go but looks like some changes were made so it works a little different now (I don't know for sure). I understand that some people have done combos.
Might need to crop photo, but that is really about it.
For school visitor monitoring.
I think the best thing is to use the WIA. I know a third party toolkit that could help you doing your requirements which is leadtools. You can check this Tutorial
I would always try to pick up something already on the web and tweak it to my own needs... some open source project or an example where the mainly portion of my app is already made.
on Codeplex you can find a nice library to work with webcams and it's simply called
WebCam Library for WinForm and WPF with C# and VB.NET
Give that a try, maybe you can even help the project, by contributing your own findings, and everyone is a winner... isn't Open Source a great idea?!
Im trying to create a media player (in C# .net 4.0) that will work on windows XP (SP3), vista and 7. Normally I would just go the easy way and use WPF's own MediaElement, but since that relies on Windows Media Player 10 or newer, that wont work as Windows XP SP3 may only have WPM9.
First I tried downloading Jerimiah Morill's WPF MediaKit sample application, but this used the EVR which wont show on my test machine (a Windows xp SP3 only with default codecs and default programs, plus the various .Net framework installations). I also downloaded the binaries and tore these apart, creating a new project only with reference to the DirectShow-dll and the bare minimums from the WPF mediakit, this time with no reference whatsoever to EVR. Still no luck. This i'm having a hard time understanding - should'nt even Windows XP be able to play movies using VMR stright out of the box?
I found some samples of media players where one of these works. This one is called DxPlay and uses directshow's graphbuilder, but is built in winforms, has some rather raw-looking code, and will not scale, seek, handle audio, and in general seems rather sketchy.
So, Is there any easy way to create a media player that will play on all the mentioned platforms without pushing WMP10+? I had high hopes for WPF MediaKit, but something is preventing it from playing on Windows XP SP3 (any solution to this would be very interesting).
Thank you very much in advance!
-ruNury
I would try to wrap VLC media player in your .Net project.
Here are some .Net projects that might help you:
http://vlcdotnet.codeplex.com/
http://sourceforge.net/projects/libvlcnet/
http://www.codeproject.com/Articles/109639/nVLC
MSDN suggest EVR (Enhanced Video Renderer) for video output in systems where it is supported: Windows Vista and later. With its introduction, its predecessors - Video Mixing Renderer filter (versions 7 and 9) were cut on smooth scaling of video. Video Mixing Renderer 7 is also less capable in terms of customization, however it consumes far less resources (does not use Direct 3D) and you can output way more videos at once.
Your standard solution here is to support both VMR and EVR output and use the latter starting Windows Vista, fall back to the former otherwise.
EVR is "unofficially" installed in Windows XP with .NET runtime and can be used with an instantiation trick: you the respective DLL is not COM registered and you cannot create an instance using CoCreateInstance API, however you succeed if you do CoLoadLibrary, DllGetClassObject and friends.
For C# development you typically consume DirectShow through DirectShow.NET Library.
I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach). I wanted to know what my options are in regards to web cams or other image capture devices that:
Are easy to work with with the
Windows SDK (particularly
DirectShow, which I plan to use
with C#)
Have drivers for both
64-bit and 32-bit Windows Vista (and
Server 2008)
I'm asking primarily so I can avoid pitfalls that other people may have experienced with web cams and to see if there are other image capture devices (or C# usable APIs) available that I should look at. I suspect that any old web cam will do but I'd rather be safe than sorry.
If you only want images, many web cams support TWAIN -- you can use with .NET using this code
http://www.codeproject.com/KB/dotnet/twaindotnet.aspx
I'm doing something very similar with webcams and have found that logitech and Microsoft branded webcams work just fine with DirectShow.
I've also found that many NEW webcams don't support twain, and WIA support for doing live captures has been removed in Vista, and doesn't exist in 2000, so Directshow has been the only thing that seems to work reliably accross OS's.