在 Windows XP 的后台进程中捕获屏幕视频 C# .NET

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4201403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:36:58  来源:igfitidea点击:

Capture Screen Video C# .NET in a Background Process in Windows XP

c#.netwindowsvideo-capturebackground-process

提问by Pratik

I want to create a background low-privilege process that captures all my screen activity from my "log on" time to "log off" time of Windows XP. It should:

我想创建一个后台低权限进程,用于捕获从 Windows XP 的“登录”时间到“注销”时间的所有屏幕活动。这应该:

  • render a video to some formats like avi, wmv, or any other video format.
  • be "lightweight" (have low overhead) as many other processes would also be running with it
  • output videos with minimal file size
  • 将视频渲染为某些格式,如 avi、wmv 或任何其他视频格式。
  • 是“轻量级”(低开销),因为许多其他进程也将与它一起运行
  • 以最小的文件大小输出视频

I am aware of CamStudioand the Easy Screen Capture Videoprogram, but I don't need such software. I need a simple function or module in C# .NET so that I can integrate, optimize or customize it as per my needs. Please don't recommend software.

我知道CamStudioEasy Screen Capture Video程序,但我不需要这样的软件。我需要一个 C# .NET 中的简单函数或模块,以便我可以根据我的需要集成、优化或自定义它。请不要推荐软件。

I know how to capture a single image as shown here:

我知道如何捕获单个图像,如下所示:

 private static void CaptureScreen()
    {
        Size s = Screen.PrimaryScreen.Bounds.Size;
        Bitmap bmp = new Bitmap(s.Width, s.Height);
        Graphics g = Graphics.FromImage(bmp);
        g.CopyFromScreen(0, 0, 0, 0, s);
        bmp.Save("C:\d.jpg");    //location to save image
    }

but I don't know how to get a video in some avi or different video formats.

但我不知道如何获取某些 avi 或不同视频格式的视频。

This isn't for spyware. I just want to monitor all my daily activity once I log on and keep it in video. Then in the future it might be possible to search the recorded sessions.

这不是针对间谍软件的。我只想在登录后监控我所有的日常活动并将其保存在视频中。然后在将来可能可以搜索记录的会话。

These questions are similar but not what I am looking for:

这些问题是相似的,但不是我要找的:

Video capture SDKs and Frameworks for Windows

适用于 Windows 的视频捕获 SDK 和框架

Alternatives to DirectShow for video capture on Windows

Windows 上用于视频捕获的 DirectShow 的替代方案

How to capture screen to be video using C# .Net?

如何使用 C# .Net 将屏幕捕获为视频?

Record Video of Screen using .NET technologies

使用 .NET 技术录制屏幕视频

Video Capturing + Uploading + Processing + Streaming back - .NET & C#

视频捕获 + 上传 + 处理 + 流回 - .NET & C#

采纳答案by Ryan Bennett

Create a Video Stream (AVI) from a Series of Images

从一系列图像创建视频流 (AVI)

I think this might be your best solution. Store all the .jpg's and create an avi from the command line at intervals. I don't see how creating video on the fly would produce a "lightweight" solution.

我认为这可能是您最好的解决方案。存储所有 .jpg 并每隔一段时间从命令行创建一个 avi。我不知道如何即时创建视频会产生“轻量级”解决方案。