"Tutorial" to explore the storm video screenshot black screen Reason

Source: Internet
Author: User

Preface


In other words, when using the Storm audio video playback, the use of other software to take screenshots of the video, and can not intercept the video screen, I here with the QQ Wubi screenshot function screenshot, the effect is as follows


For this kind of situation, also often met before, but also did not think about why.


As you can see, a black screen is just a video playback interface, and playlists and borders can be displayed.

Then I asked in the group.

Some say is the storm top, this I first ruled out, even if the top, you can cut to the map.

The side dish says the paint redraw, the screenshot seems to have nothing to do with repainting.

In addition, from a technical point of view, it is said that the storm is written by VB, video rendering with Microsoft's program interface, is based on DirectX, and then check the DirectX data, according to Baidu Encyclopedia information http://baike.baidu.com/view/15762. HTM to see how DirectX is displayed


DirectX Display principle


Usually the data we see on the screen is sent to the display via primary surface, and what is primary surface. Chinese is called the main display surface, that is to say, we currently see the screen image data from this surface, in addition to the main surface and off-screen surface, called Offscreensuface. The data in this surface is not displayed directly on the screen.

Most video playback software is now written in DDraw (accelerated), and a surface called overlay is used.

Then what is Overlay ?

According to Microsoft Official: Http://msdn.microsoft.com/en-us/library/aa916217.aspx,Overlay is hardware-only support, DDraw does not use software to achieve this function. What's special about this surface is that it's the equivalent of a piece of plastic on the screen, which means that if you use this surface, it's on top of all your surface. When the display device displays data to the screen, it first determines if there is a overlay, and if so, displays the pixels in overlay, and if not, uses the pixels in primary surface.

Well, we now know that the storm is also written in DDraw, and uses a surface called overlay to accelerate, and this surface is purely hardware-supported, at the forefront of all surface.


Software Screenshots


But the storm software comes with screenshots can be screenshots, the screenshot of the black screen there is also the reason for the screenshot software.

The analysis from the above overlay that it is at the forefront of all surface, and that the data we see on the screen is sent to the monitor via primary surface, will it be overlay that primary surface is blocked, So the software can't intercept the graph.

Title, our usual screenshot function intercepts data from the normal primary surface, doesn't intercept data from overlay surface, and Microsoft doesn't provide a common API to get the data from overlay surface, so When we open a player to play the video, the screenshot shows that the player window is black. The reason is that this area corresponds to the overlay, then of course is not intercepted, black screen is not surprising.


The final statement: The black screen is caused by ddraw acceleration.


Resolve screenshot Black Screen


Since overlay is purely hardware-supported, can we turn off ddraw acceleration? The answer is yes.

Most software, in addition to the DDraw rendering mode, also provides a software renderer mode, which is the software mode, which is used when the DDraw acceleration is not available, so one way to avoid a screenshot black screen is to turn off ddraw acceleration, Forcing the software to use software renderer mode so that Overlay surface does not exist, it will not black screen.


We can turn off DDraw acceleration in the DirectX Control Panel, and if the DirectX SDK is installed, simply enter DxDiag in the run bar to open the DirectX Control Panel

This method turns off the DDraw acceleration of the system, so all other software in the system cannot use DDraw acceleration. Of course, use the software itself to switch off the acceleration is also possible, and then you can take screenshots.


gets the data in the overlay.


It is said that the use of hook technology may be done, but this technology, has always been killed soft blacklisted, get out also outweigh the gains, interested in children's shoes to pay attention to it ...


Summary


Before consulting the material, I also do not understand this, and then through a variety of Baidu Google Microsoft + practice, the principle of this thing is also understood.

So, life is full of knowledge, the key is to need a pair of eyes to discover knowledge, and then verify it, break it, innovate it, and finally replace it, haha


This article is from the "Ajmer" blog, please be sure to keep this source http://infohacker.blog.51cto.com/6751239/1211253

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.