我需要用“C”创建一个小型远程桌面软件,可以在各种平台(linux、freebsd、windows...)上编译,我已经研究了各种图像格式一段时间,但仍然无法想出一个使用它们是个好主意,现在,这就是我所做的:
1. Convert All Formats into Windows Bitmap (XImage,...etc)
2. Do a byte-to-byte comparion and replace the identical bytes with zeros
3. Preform a RLE (Run Length Encoding) on the Resulted data.
4. Transmit the Packet to the Server
5. Inverse the Operation on the Server by Reconstructing the Image through the previous image (Comparing Last Image with the New one Discarding Zero Bytes after RLE)
但这往往非常慢,因为位图图像格式已经有非常大的文件,因为它不包含压缩,并且在 Mac OS X 等平台上,位图尺寸大得离谱,因为非常高分辨率。
有没有更快更好的桌面流媒体方式?
I needed to create a small remote desktop software in 'C' that compiles on various platforms (linux, freebsd, windows...) i've been looking into various image formats for a while, but still couldn't come up with a good idea to use them, right now, here is what i do:
1. Convert All Formats into Windows Bitmap (XImage,...etc)
2. Do a byte-to-byte comparion and replace the identical bytes with zeros
3. Preform a RLE (Run Length Encoding) on the Resulted data.
4. Transmit the Packet to the Server
5. Inverse the Operation on the Server by Reconstructing the Image through the previous image (Comparing Last Image with the New one Discarding Zero Bytes after RLE)
but this tends to be very slow, since the bitmap image format has very big files already because it contains no compression, and on platforms such as Mac OS X, the bitmap size is rediculously big because of the very hight resolution.
is there any faster and better way to do desktop streaming?
发布评论
评论(1)
对于计算机屏幕,您可以考虑一些事情,主要是屏幕的一小部分可能会随时发生变化。
您可以查看以下三种方法:
根据您想要编写服务器的方式,您也许能够从操作系统获取关于屏幕的哪些位已更改的提示,以减少您必须执行的处理量。
最后,(如果这不是家庭作业)然后看看 VNC 已经做得很好了,甚至还有 java 或 c# 版本。
There are things you can take into account with computer screens, mainly that only small portions of the screen are likley to change at any one time.
You could look these three approaches:
Depending on how you want to write the server, you may be able to take hints from the OS as to which bits of the screen have changed to reduce the amount of processing you have to do.
Lastly, (if this is not homework) then look at things like VNC that already do this pretty well, there are even java or c# versions.