在Linux上的屏幕捕获最快方法 [英] Fastest method for screen capturing on Linux

查看:789
本文介绍了在Linux上的屏幕捕获最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是一个与此相似

This question is similar to this one

最快的方法捕捉

但用于Linux / X11。

but for linux/X11.

要更具体地,我需要一个方法来捕获一个窗口(在窗口交替 - 打印屏幕的方案当量)运行的象素图象上的X11 diplay

To be more specific, i need a method to capture the pixel images of one window (the programmatic equivalent of alt-print screen in windows) running on a X11 diplay.

注意事项及要求:

1)即使放置在被捕获窗口上方的新窗口,像素图像还是应该指向原始应用程序窗口没有任何遮挡

1) Even if a new window is placed on top of the window that is being captured, the pixel image should still point to the original application window without any occlusion

2)不需要它,要被用户看到的应用程序窗口,我只需要存储像素缓冲器/视频图像的目的

2) it is not needed that the application window to be seen by the user, i just need to store the pixel buffers/images for video purposes

,我已经探索其他替代方案:

other alternatives that i've explored are:

1)xvfb的 - 它的工作原理,但它确实做CPU的渲染,这是缓慢的,
浪费了良好的GPU的

1) xvfb - it works but it does does CPU rendering, which is slow and wasteful of a good GPU

2)许多LXC内部X11 - 理论上可以工作,但过程复杂
安装程序,我不知道它会与许多窗户被很好地扩展
捕获

2) x11 inside many lxc - theoretically could work but is complex to setup, and i'm not sure it will scale well with many windows being captured

建议和想法,欢迎

推荐答案

这是可以使用<一个href=\"http://virtualgl.svn.sourceforge.net/viewvc/virtualgl/vgl/tags/2.3.2/doc/index.html#hd009001\">VirtualGL在硬件加速的服务器。基本上只配置服务器appropiately,然后可以在同一台机器上或在机器上在同一网络中,运行

This is possible using VirtualGL in a server with hardware acceleration. Basically just configure the server appropiately, then either on the same machine or on a machine in the same network, run

export DISPLAY=<your xvfb display>
vglrun <your_app>

这将具有以下优点:

1)你的应用程序将呈现使用virtualGL,这将使用硬件

1) your app will render using virtualGL, which will use the hardware

2)VirtualGL会显示您的3D背景下Xfvb显示器内部,这只会渲染2D小部件CPU

2) VirtualGL will display your 3D context inside the Xfvb display, which will only render the 2D widgets in CPU

3)配置Xvfb来渲染到帧缓冲

3) configure Xvfb to render to a framebuffer

4)利润!

这篇关于在Linux上的屏幕捕获最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆