Remote Control: screen capture Summary

Source: Internet
Author: User
In order to achieve high-speed screen transmission, it is inevitable that the entire screen cannot be captured every time. The consequence of this operation is that the amount of data to be transmitted is too large and the bandwidth is limited (Suppose it is about 20 KB ~ 50 K. In order to make the display smoother, you must transmit images of nearly multiple frames with limited bandwidth within a unit of time. Differential screenshots !

The following three solutions are available for implementing differential screenshots:

    1. (Bitblt or DirectDraw) + (interline sampling or CRC or hash)
    2. HOOK: see VNC implementation
    3. Virtual video card: refer to the example of Chen Jingtao. No source code (Delphi)

Note: currently, the first solution is generally used to find the source code on the Internet.

When using differential screenshots, you may need to split the screen into N small areas.AlgorithmDetermine the changed part. The area size is generally set based on experience!

To further reduce the amount of data to be transmitted, you can also perform selective compression. The compression method also has two options:

    1. BMP-> JPEG: lossy compression with relatively high compression ratio
    2. General compression: Zip, zlib (Ex), etc.

Through the above steps, you can achieve relatively smooth screen transmission on the Wide Area Network. Of course, the virtual graphics card method seems to be the fastest, followed by the Hook method, however, the implementation difficulty is also from high to low!

At present, the main bottleneck of this application isBandwidthFor this reason, we need to minimize the amount of data obtained after the difference screenshots, but the test results can only achieve the effect of several frames per second, and someArticleThe effects of dozens of frames and hundreds of frames (Note: I personally think there is moisture ^_^) are far different!

2007/07/06 update:

The virtual graphics card driver is essentially a display mirror driver. After installation, the driver and the physical graphics card driver will receive identical events. Based on these events, you can determine which areas of the screen have changed, in addition, you can directly operate the video memory in the driver, without consuming a lot of CPU for bltting!

It is said that pcAnywhere, Remote Desktop (after Win2000) and some remote control software are implemented using this technology.

DirectDraw seems to be able to directly operate on existing ones. I don't know how much efficiency is compared to using mirror driver !?

Reference: http://www.osronline.com/showthread.cfm? Link = 111960

2007/07/11 update:

When using the GDI bitblt function or DirectDraw for high-speed screenshots, you must save a copy of the screen to find out which areas have changed. By comparing the latest screen image with the saved copy, to get the region that has changed! It is very slow to copy a screen using bitblt. In order to get a screenshot of 1280*720 size, it takes about Ms on my machine. DirectDraw is much better at this point.

VNC uses the Hook method to intercept all related Windows messages, and then determines the impact of each message on the rectangular area of the screen, and combines these rectangular areas into a region, update these regions during update.

The principle of using a virtual driver is similar to that of the hook method. However, instead of Windows messages, the driver directly intercepts the calling of the GDI function, in these functions, the changed rectangular area is obtained and combined into the final region.ProgramIt is at a different level of privilege. Therefore, data must be uploaded to ring3 after reading the video. This is very troublesome to handle, and inefficient at handling!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.