视频捕捉SDK教程:捕捉视频和存储文件

video_capture

的LEADTOOLS视频捕捉SDK包含高级功能,简化从设备获取视频的过程和照相机。SDK为开发人员提供了所有必要的工具来处理不同的视频源包括网络摄像机,网络摄像头,捕捉卡,电视调谐器,DV摄像机等等。捕获的视频后,开发人员可以很容易地转换和存储视频使用各种各样的编解码器像H.265, h, MJPEG, mpeg - 2。导致库提供最高的压缩、速度和回放质量的市场上任何其他多媒体SDK。188宝金博怎么下载

致力于整合视频捕捉到您的应用程序呢?迅速开始下面的代码或检查捕获视频源文件对于一个完整的教程。

使用System.Windows.Forms;使用Leadtools;使用Leadtools.Mult188宝金博怎么下载imedia;静态void Main (string [] args) {UnlockMult188宝金博怎么下载imedia ();CaptureVideo ();}静态孔隙CaptureVideo(){字符串outputFile = @“C: \ LEADTOOLS21 \资源\ \ captured.avi图像”;CaptureCtrl捕捉= new CaptureCtrl(真正的);int deviceCount = capture.VideoDevices.Count;如果(deviceCount < 1){控制台。WriteLine(“不兼容的设备。 Exiting."); return; } Console.WriteLine("Select device by typing its number and pressing Enter:"); for (int n = 0; n < deviceCount; n++) Console.WriteLine(n.ToString() + " : " + capture.VideoDevices[n].FriendlyName); int deviceIndex = int.Parse(Console.ReadLine()); Console.WriteLine("Preparing to capture . ."); capture.VideoDevices.Selection = deviceIndex; capture.TargetFile = outputFile; capture.TargetFormat = TargetFormatType.AVI; // select a suitable compressor capture.VideoCompressors.MJpeg.Selected = true; //use CaptureMode.VideoAndAudio if an audio device is also selected. capture.StartCapture(CaptureMode.Video); Console.WriteLine("Capturing to file. Press any key to stop capture..."); while (!Console.KeyAvailable) { System.Windows.Forms.Application.DoEvents(); int capMilliSeconds = (int)(1000 * capture.CaptureTime); if (capMilliSeconds % 1000 == 0) // print a dot every second { Console.Write(". "); System.Threading.Thread.Sleep(1); } } capture.StopCapture(); Console.ReadKey(true); Console.WriteLine($"\nFinished capturing {capture.CaptureTime} seconds to file {outputFile}. Press any key to continue..."); Console.ReadKey(true); }

试一下!

为了测试这个为自己,一定要获得最新的LEADTOOLS SDK代码免费如果你已经不是直接从我们的网站。这个试验有利于60天,无限制的聊天和电子邮件的支持。

支持

准备和运行这个示例需要帮助吗?联系我们的支持团队免费的技术支持!对于定价或许可的问题,您可以联系我们的销售团队在704-332-5532 (sales@leadtools.com)或打电话给我们。

这一条目将发表在188宝金博怎么下载多媒体成像和标记,,,,。书签的永久链接

留下一个回复

你的电子邮件地址将不会被发表。必填字段标记*