开发者

What is The Easiest, fastest Way to capture video stream from camera with C#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

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 question

What 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜