4

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 Answers3

6

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.

Darren
  • 4,408
  • 4
  • 39
  • 57
Sasha Yakobchuk
  • 471
  • 6
  • 12
3

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

Sheridan
  • 68,826
  • 24
  • 143
  • 183
  • Thanks for you assistance. but I have tried all the links but main requirement is quality of image. and if we extract the image from video , the quality will be very low. – Akhilesh Chaturbedi Jul 10 '14 at 08:15
  • If the quality of the video is low then any images taken from it will also be of low quality. – Sheridan Jul 10 '14 at 08:31
  • Just a note Expression Encode is no longer in development also Mainstream support ended last year. – Peter May 19 '16 at 06:27
0

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.

Peter
  • 37,042
  • 39
  • 142
  • 198
  • does AForge can save sound with videos? – daniel Nov 22 '16 at 09:53
  • @daniel i have no idea i have only grabbed a single frame at a time and had no need for sound.. but they have great documentation on their homepage so i suggest you check that out. – Peter Nov 22 '16 at 09:57
  • Isn't AForge designed for Windows Forms and not WPF? It gets webcam data as Bitmap objects. How do you display those in a WPF Image? Also, AForge does not do sound. – Kyle Delaney May 15 '17 at 17:34
  • @KyleDelaney yes its winforms but thats no show stopper, just use `` and then save the bitmap to a memory stream and load it as a `BitmapImage`. – Peter May 16 '17 at 06:51
  • @KyleDelaney: I know it's old, but for future readers, `Bitmap`s can easily be converted to `BitmapSource` or `ImageSource`. SO has several posts on this that you can google. – dotNET Mar 14 '20 at 08:09