- 交通部:
- What is the framerate of VNC connection (in frames/sec) - or rather, who determines it: client or server?
- Any other suggestions for desktop screen capture - but "correctly timecoded"/ with unjittered framerate (with a stable period); and with possibility to obtain it as uncompressed (or lossless) image sequence?
Briefly - I have a typical problem that I am faced with: I sometimes develop hardware, and want to record a video that shows both commands entered on the PC ( desktop capture ), and responses of the hardware ( live video ). A chunk of an intro follows, before I get to the specific detail(s).
Intro/Context
现在,我的战略是使用视频摄像机记录硬件测试过程(作为直播录像),同时进行桌面记录。 录像摄影机制作了29.97(30)FPS MPEG-2 .AVI录像;我希望将桌面录制作为全国国民党的图像序列,其速度与录像相同。 那么,设想是:如果两个视频的基数率相同;那么我只能简单地讲几句。
- align the time of start of the desktop capture, with the matching point in the live video
- Set up a picture-in-picture, where a scaled down version of the desktop capture is put - as overlay - on top of the live video
- (where a portion of the screen on the live video, serves as a visual sync source with the desktop capture overlay)
- Export a final combined video, compressed appropriately for the Internet
原则上,我猜测,我们可以为这一进程使用诸如<编码>>ffmpeg等指挥系统工具;然而,我更希望利用全球情报系统寻找两个视频的调和起点。
Eventually, what I also want to achieve, is to preserve maximum quality when exporting the final video: the live video is already compressed when out of the camera, which means additional degradation when it passes through the Theora .ogv codec - which is why I d like to keep the original videos, and use something like a command line to generate a final video anew, if a different compression/resolution is required. This is also why I like to have the desktop capture video as a PNG sequence (although I guess any uncompressed format would do): I take measures to adjust the desktop, so there aren t many gradients, and lossless encoding (i.e. PNG) would be appropriate.
Desktop capture options
Well, there are many troubles in this process under Ubuntu Lucid, which I currently use (and you can read about some of my ordeals in 10.04: Video overlay/composite editing with Theora ogv - Ubuntu Forums). However, one of the crucial problems is the assumption, that the frame rate of the two incoming videos is equal - in reality, usually the desktop capture is of a lower framerate; and even worse, very often frames are out of sync.
因此,这需要在录像编辑前坐视灯,并手工切割和编辑框架级低于秒钟的剪辑——需要
就我所知,只有很少
- Have your target PC (laptop) clone the desktop on its VGA output; use a VGA-to-composite or VGA-to-S-video hardware to obtain a video signal from VGA; use video capture card on a different PC to grab video
- Use recordMyDesktop on the target PC
- Set up a VNC server (vino on Ubuntu; or vncserver) on the target PC to be captured; use VNC capture software (such as vncrec) on a different PC to grab/record the VNC stream (which can, subsequently, be converted to video).
- Use
ffmpeg
withx11grab
option - *(use some tool on the target PC, that would do a DMA transfer of a desktop image frame directly - from the graphics card frame buffer memory, to the network adapter memory)
Please note that the usefulness of the above approaches are limited by my context of use: the target PC that I want to capture, typically runs software (utilizing the tested hardware) that moves around massive ammounts of data; best you could say about describing such a system is "barely stable" :) I d guess this is similar to problems gamers face, when wanting to obtain a video capture of a demanding game. And as soon as I start using something like recordMyDesktop
, which also uses quite a bit of resources and wants to capture on the local hard disk - I immediately get severe kernel crashes (often with no vmcore generated).
因此,在我看来,我通常会参与一个second的电脑——以掌握和记录目标PC desktop。 除此以外,我迄今为止可以看到的与上述选择相符合的利弊如下。
(Desktop preparation)
对于下文讨论的所有方法,我倾向于“准备”桌面前言:
- Remove desktop backgrounds and icons
- Set the resolution down to 800x600 via System/Preferences/Monitors (
gnome-desktop-properties
) - Change color depth down to 16 bpp (using
xdpyinfo | grep "of root"
to check)
......以尽量减少台式捕获软件的负荷。 请注意,改变乌班图的色深度需要修改xorg.conf;然而,“
为了保持图形资源使用率低,我通常有<条码>compiz残疾,或者说,我有“None”的系统/参考/设计/早期效果。 然而,在我尝试通过将视觉效应置于“热”之上(更多><>>>>/>影响产生 这也是最有意义的选择(因为它不仅需要额外购买一台,而且还需要购买两部硬件:VGA转换器和录像带卡);而且主要适用于膝上型计算机(既具备屏幕+额外甚高分辨率输出结果),而对于 desktop来说,也可能需要投资于额外的制图卡或甚高分辨率的克隆硬件。 然而,这也是唯一不需要目标PC任何附加软件(因此使用目标CPU的0%处理能力)的备选办法,也是唯一一个用 实际上,由于我已经拥有像捕获卡这样的一些东西,我已经投入了VGA转换器,期望它最终能够让我制作最后的“合并”录像,其中只剩下5个点,只剩下一个指挥线;但我尚未看到这一进程是否将按计划进行。 I m还浪费了尽可能将 desktop作为不压缩的录像带——800x600,30 fps。 如果你在没有任何论点的情况下操作 因此,我尝试的是:,在网络上分享动力;然后在目标PC上,I d 链接到这一驱动力——并指示代码 请注意,虽然这一指挥系统将使用网络地点处理临时档案(并因此有可能使用<代码>recordMyDesktop,与我的软件平行运行),但一旦Ctrl-C点击,该指挥部将开始直接编码和保存<代码>capture.ogv(但当时我并未真正注意:) 我的纳格斯中首先有<代码>recordMyDesktop,即你不能指示它保存临时档案,避免最终编码:你可以使用Ctrl++。 pa胎加胎——或者在头胎后你能够很快打到Ctrl-C,导致它坠毁;然后将离开临时档案(,如果你很快不打Ctrl-C,则该方案将“ up顶......>。 可以说: ......以便转换原始临时数据。 然而,通常情况下, 然后是制定基准——显然,你可以采用<代码>-fps N备选办法设定requestedframerate;然而,这并不能保证你会实际获得该基准;例如,我获得: ......用我的测试软件进行捕获;这意味着实际达到<>。 比率更像25*2983/6032=12.3632 fps! 很显然,这些框架被放弃,大多数都显示为 。 然而,如果我把所要求的假肢降低到12个,那么根据所节约的报告/总的报告,我就达到了11个假点;在这种情况下,录像回击率高。 我仍然 t着把这种捕捉与实在在的录像相匹配的拖车,因此,如果实际挽救了这些框架,我就没有想法,也没有准确的时间。 对我来说,国家民事警察局的捕获包括:在目标PC上运行一个国家民事警察局服务器,并在常设计算机记录器上运行<代码>vncrec(前版)。 作为VNC服务器,我使用 另一方面,当<代码>vncrec在记录器PC上捕获时,该编码还引出一个窗口,显示在实时上看到的目标台;当目标上出现大量更新(即整个窗户移动)时,可以明显看到记录器上更新/更新率的问题。 但是,仅作少量更新(即仅仅是一个 cur子在静态背景下移动),情况似乎就是如此。 这使我很想知道我与这一职位有关的主要问题之一——这是什么——在武革委的联系中确定框架? 我没有找到对此的明确答案,但从胎面和胎面(见以下的参考文献)来看,我发现: ......这意味着,不能以稳定、定期的费率(如录像)来说明。 就用户而言,截至<代码>vncrec,我通常被宣布为10 fps,尽管框架可能相当分散/倾斜(这就要求录像编辑进行切割)。 注:vncrec-twibright/README “ 影片的样本率是全国公民和部落居民协会拖欠或压倒的10 MOVIE FRAMERATE 环境变数,如未具体说明,则10:;然而,该页还称“VNCREC_MOVIE_FRAMERATE-Specifies framework rate of theproduct 电影. 只具有驱散方式的效力。 Default to 10. Try 24, 摘自10。 如果看到“ ... which shows that some timestamps are written - but whether those timestamps originate from the "original" target PC, or the recorder one, I cannot tell.
EDIT: thanks to the answer by @kanaka, I checked through vncrec/sockets.c again, and can see that it is the 不管怎样,在我看来,服务器发送——和 我还愿指出,在我的专用膝上型计算机上,;因此,无线电话是我的唯一选择,可以进入路由器和当地网络,速度远低于100MB/s,路由线人操作。 然而,如果被捕获的圈子由于装上目标PC而造成错误的时间点,那么我不认为良好的网络带宽会太大。 最后,就VNC而言,还可以尝试其他办法,例如:VNCast 服务器(<>promising,但需要一定时间从源中进行建设,并且正在“早期实验版本”上”;或。 曾有过这么多的事情,但我曾尝试过有关 ......的确包含一个档案,但 does produce .png images - but with compression artifacts (result of the compression involved with 因此,I m不 liking 诚然,我并不肯定存在这样的情况——事实上,我要说的是: 我这里没有专家,但我猜想: 如果能够从图形卡(或保持现有桌面轨道图的缓冲)中开始传承( 与此类似的建议当然认为:网络带宽(for 800x600, 30 fps 至少800*600*30 = 43200000 bps = 42 MiB/s,这应是当地100个甲基溴/秒网的OK);其他PC大量硬磁盘,记录和随后能够读到该原始数据的软件,并产生基于该软件的图像序列或录像:) 带宽和硬磁盘要求我能够生活——只要能够保证有稳定的框架数据和无压缩数据;这就是为什么我热心听已经存在的情况。 --———— 确实,我猜测是这样——正如我可以这样说: 任何关于工具或过程的建议,都可能导致桌面捕获 ......这最终将便于进行单一指挥线处理,以制作图像-图像传输视频——将受到极大赞赏! Thanks in advance for any comments,compiz
时没有专有的驾驶人选择”,尽管所有混杂和效果只能 我的眼睛:]。Cloning VGA
recordMyDesktop
recordMyDesktop
,则首先掌握(例如)原始图像数据,如/tmp/rMD-session-7247
;在你要求Ctrl-C打断之后,将这种原始图像数据编码为正文。 显然,在像我的测试软件一样的硬磁盘上收集大量图像数据(这也导致大量数据),通常是造成一种不稳定的因素:recordmydesktop --workdir /home/user/.gvfs/test on 192.168.1.100/capture/ --no-sound --quick-subsampling --fps 30 --overwrite -o capture.ogv
recordmydesktop --rescue /home/user/.gvfs/test on 192.168.1.100/capture/rMD-session-7247/
recordMyDesktop
本身在履行这一“rescue”的过程中会发生过失。 虽然,我想要保存时间档案的原因,是了解情况时的mont。 请注意,“-on-the-encoding
”将完全避免使用时间文档,即使用更多的邮联处理权(对我来说,这再次造成坠毁)。recordmydesktop --fps 25
...
Saved 2983 frames in a total of 6023 requests
...
VNC capture
vino
,即“系统/参考/重新设计桌面(参考)”。 显然,即使vinoture可能不是管理的最容易的事情,vino
作为服务器似乎对目标PC不征税;因为与我的测试软件平行运行时,我有没有经历过坠毁。
vncrec/sockets.c
来源,则可以看出:void print_movie_frames_up_to_time(struct timeval tv)
{
static double framerate;
....
memcpy(out, bufoutptr, buffered);
if (appData.record)
{
writeLogHeader (); /* Writes the timestamp */
fwrite (bufoutptr, 1, buffered, vncLog);
}
writeLogHeader
function itself calling gettimeofday
; so the timestamps it writes are local - that is, they originate from the recorder PC (and hence, these timestamps do not accurately describe when the frames originated on the target PC). vncrec
,作为客户接收——,每当;而且只是在随后从原始捕获中输入一个视频文件的过程中,才确定/推断某种形式的基准率。ffmpeg with x11grab
# target
ffmpeg -f x11grab -b 8000k -r 30 -s 800x600 -i :0.0 -f rawvideo - | nc 192.168.1.100 5678
# recorder
nc -l 0.0.0.0 5678 > raw.video #
ffplay
不能正确阅读所收集的档案;而:# target
ffmpeg -f x11grab -b 500k -r 30 -s 800x600 -i :0.0 -f yuv4mpegpipe -pix_fmt yuv444p - | nc 192.168.1.100 5678
# recorder
nc -l 0.0.0.0 5678 | ffmpeg -i - /path/to/samplimg%03d.png
yuv4mpegpipe
, I guess). ffmpeg
+*( graphics card -> DMA -> network )
Cheers!
References