视频处理控件LEADTOOLS Multimedia SDK入门教程:如何捕获视频并将其存储到文件

LEADTOOLS 视频捕获包含高级功能,可简化从设备和摄像机捕获视频的过程。的SDK为开发人员提供了与不同的视频源配合使用所需的所有工具,包括 络摄像机, 络摄像头,采集卡,电视调谐器,DV摄像机等。

您可以使用

子工具LEADTOOLS 视频捕获包含高级功能,可简化从设备和摄像机捕获视频的过程。DK为开发人员提供了与不同的视频源配合使用所需的所有工具,包括 络摄像机, 络摄像头,采集卡,电视调谐器,DV摄像机等。捕获视频后,开发人员可以使用各种编解码器( 例如H.265,H.264,MJPEG和MPEG-2)轻松地转换和存储视频 。LEAD库提供了市场上任何其他多媒体SDK最高的压缩,速度和播放质量。

是否正在将视频捕获集成到您的应用程序中体代码如下:

using System.Windows.Forms;using Leadtools;using Leadtools.Multimedia;static void Main(string[] args){    UnlockMultimedia();    CaptureVideo();}static void CaptureVideo(){    string outputFile = @"C:LEADTOOLS21ResourcesImagescaptured.avi";    CaptureCtrl capture = new CaptureCtrl(true);    int deviceCount = capture.VideoDevices.Count;    if (deviceCount < 1)    {        Console.WriteLine("No compatible devices found. 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热门开发工具推荐

2. LEADTOOLS Medical Imaging Suite Developer Toolkit | 下载试用:帮您开发功能强大的PACS和医学成像应用程序。

3. LEADTOOLS Multimedia Suite Developer Toolkit | 下载试用:是专为开发各种跨行业音频/视频应用程序所设计的多媒体开发工具包

4. LEADTOOLS Document Suite Developer Toolkit | 下载试用:这套强大的工具利用了LEAD行业领先的图像处理技术来智能地识别文档的特征,而根据文档的特征可以识别扫描的或传真的任何类型的表格图像。

*****************************************************************************************

LEADTOOLS技术交流群现已开通,QQ搜索群 :或者扫描下方二维码即可加入!

有任何疑问点击【咨询客服】

视频处理控件LEADTOOLS Multimedia SDK入门教程:如何捕获视频并将其存储到文件
标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年4月7日
下一篇 2021年4月7日

相关推荐

发表回复

登录后才能评论