What is The Easiest, fastest Way to capture video stream from camera with C#? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
C开发者_开发知识库losed 6 years ago.
Improve this questionWhat is The Easiest, fastest Way to capture video stream from camera with C#?
Simpliest and easiest probably would be using Microsoft Expression Encoder SDK:
static void Main( string[] args )
{
var job = new Microsoft.Expression.Encoder.Live.LiveJob();
job.AddDeviceSource( job.VideoDevices[0],job.AudioDevices[0] );
var w = new System.Windows.Forms.Form();
w.Show();
var source = job.DeviceSources[0];
source.PreviewWindow = new Microsoft.Expression.Encoder.Live.PreviewWindow( new System.Runtime.InteropServices.HandleRef(w, w.Handle) );
Console.ReadKey();
}
Take a look at DotImaging project on Github: https://github.com/dajuric/dot-imaging
var reader = new CameraCapture(); //create camera/file/image-directory capture
reader.Open();
var frame = reader.ReadAs<Bgr<byte>>(); //read single frame
reader.Close();
and more detailed sample: https://github.com/dajuric/dot-imaging/blob/master/Samples/Capture/Program.cs
NuGet package is available at: https://www.nuget.org/packages/DotImaging.IO/
It is pretty easy.
精彩评论