Grab picture from web cam in WPF Application?

27.4k views Asked by At

I am using web cam in WPF application. I am using Expression Encoder for video capture. for video capture I have created Job and its working properly. While I want to get picture with same resolution as video is. for this I am using ffmpeg to extract first frame from video. but quality of image is very low. the priority is that image quality should be best of attached web cam and resolution should be as much as video is.

Either we have any better option in Expression Encode for taking picture or kindly help me with any alternative.

3

There are 3 answers

3
Sheridan On

For some reason, accessing images from a web cam is far more complicated then it should be. While I have not used the Expression Encode application, I can provide you with two links to CodePlex, where you can find two different libraries that could help you to solve your problem. Please see the following pages:

WebCam Library for WinForm and WPF with C# and VB.NET

WPF MediaKit - For webcam, DVD and custom video support in WPF

Alternatively, if you're happy with using Expression Encode, then you could take a look at the following links:

Extracting still pictures from movie files, with C#
Extract frames from video files – The Code Project – Multimedia

0
Sasha Yakobchuk On

You can have a look at this control:

The control provides the following functionalities:

  • Gets a list of available web camera devices on a system.

  • Displays a video stream from a web camera device.

  • Gets the current image being captured.

Requirements

  • The WPF version of the control is implemented using .NET Framework 4 Client Profile.

  • The control uses the VMR-9 renderer filter available since Windows XP SP2.

  • The control supports both x86 and x64 platform targets.

5
Peter On

I would recommend AForge.Net, it works flawless, free and licensed under LGPL v3 license, it also seems to work in both 32 and 64 bit.

The only drawback is that you need ~400 kb worth of dlls to get the webcam control.