How to capture screen with overlay surface? Normal printscreen does not capture overlay surface. But I must write an application/module that captures overlay surface as well as normal desktop area. I know that disabling hardware acceleration will do the trick, but it is not an option for me. The system must run normally. I've also heared that DirectX(DirectX) API can be used for this purpose(like Snagit?), but I don't know the details(I've searched Google, but failed to find an article for it). Using a capture application is not an option for me, since I must write it - or have the source with low price and free distribution rights. Capturing only the overlay surface (without blending normal desktop screen) can be an option for me.
As you have observed SnagIt can do it. AFAIK, the technique TechSmith is using is unknown by anyone who has posted here thus far on this issue. I would have spent some time researching in the Windows source code for you if your attitude in the other group you posted to had been better. Maybe you will learn something from this for the future.
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
> As you have observed SnagIt can do it. AFAIK, the > technique TechSmith is using is unknown by anyone who has > posted here thus far on this issue. I would have spent > some time researching in the Windows source code for you > if your attitude in the other group you posted to had > been better. Maybe you will learn something from this > for the future.
This means I should not share my theory on how SnagIt captures overlays?
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
>> As you have observed SnagIt can do it. AFAIK, the >> technique TechSmith is using is unknown by anyone who has >> posted here thus far on this issue. I would have spent >> some time researching in the Windows source code for you >> if your attitude in the other group you posted to had >> been better. Maybe you will learn something from this >> for the future.
> This means I should not share my theory on how SnagIt > captures overlays?
Your call. Personally, I'm not going to slog through 4k lines of overlay code in CCP for the OP who was rude when I pointed to a post that would lead him to the most appropriate newsgroup for his question. The OP didn't have the courtesy to acknowledge his mistake when he eventually figured it out either. OTOH, I did go through the CCP code for the problem with the VMR9 in exclusive mode at the end of a long day yesterday. That was for someone who was polite and I brought up the potential issue I found with the VMR9's author at MSFT as you saw on our private list. But that poster has been polite in his exchanges.
> Your call. Personally, I'm not going to slog through 4k > lines of overlay code in CCP for the OP who was rude when
Then I'll save the answer for the next time this question comes up. However, you can imagine what it is when I say that it's not a hidden feature of DD and that it is the same technique I would have used :-)
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
It's funny to see A to say that B is rude - when B was upset on A's rude posting for the first time. Being productive is better than being funny (or seeing A whining) for this case, but it may be impossible with this thread.
> >> As you have observed SnagIt can do it. AFAIK, the > >> technique TechSmith is using is unknown by anyone who has > >> posted here thus far on this issue. I would have spent > >> some time researching in the Windows source code for you > >> if your attitude in the other group you posted to had > >> been better. Maybe you will learn something from this > >> for the future.
> > This means I should not share my theory on how SnagIt > > captures overlays?
> Your call. Personally, I'm not going to slog through 4k lines of overlay > code in CCP for the OP who was rude when I pointed to a post that would > lead him to the most appropriate newsgroup for his question. The OP didn't > have the courtesy to acknowledge his mistake when he eventually figured it > out either. OTOH, I did go through the CCP code for the problem with the > VMR9 in exclusive mode at the end of a long day yesterday. That was for > someone who was polite and I brought up the potential issue I found with > the VMR9's author at MSFT as you saw on our private list. But that poster > has been polite in his exchanges.
> It's funny to see A to say that B is rude - when B was upset on A's > rude posting for the first time. Being productive is better than being > funny (or seeing A whining) for this case, but it may be impossible > with this thread.
What is rude about:
"Did you read the post titled "DO NOT POST HERE"?"
which is *exactly* what I posted? The post in question titled "DO NOT POST HERE (Please read)" is listed right before yours in the newsgroup.
Your post however *is* rude:
"No. so what?
You can tell me the right place to post about the topic, rather than meaningless ramblings."
If you had read the post I referenced rather than posting this you would have seen that is *exactly* what it did and, if you were courteous, would have thanked me for pointing you to the correct group.
I recommend you think before you dig yourself into a deeper hole.
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
FYI(maybe you're not interested at all), SnagIt (version 7.2.2) failed to capture the overlay screen on my PC. I've heared that SnagIt can do it on newsgroup, but when I ran it on my PC today, it could not capture the overlay screen. Of course I used DirectX option(i. e., Input: DirectX).
I think the viable solution for this is preventing applications from using hardware overlay. I've read that recent DirectShow versions (VMR7, VMR9) do not use hardware overlay for more flexible video mixing (although it is not the default), so preventing the use of hardware overlay is not very harsh option for the users nowadays, if he/she want to capture the screenshot.
But forcing users to arrange the slidebar on the hardware acceleration dialog is not very comportable option. But since the overlay screen is very limited resource and application give up and use GDI or other option when it cannot get an overlay screen, a screen capture application can actually disable overlay screen by grabbing it itself before any other application can get it. This requires that screen capture application must run before the movie player, it is acceptable for my situation.
> As you have observed SnagIt can do it. AFAIK, the technique TechSmith is > using is unknown by anyone who has posted here thus far on this issue. I > would have spent some time researching in the Windows source code for you > if your attitude in the other group you posted to had been better. Maybe > you will learn something from this for the future.
> SnagIt (version 7.2.2) failed > to capture the overlay screen on my PC. I've heared that SnagIt can do > it on newsgroup, but when I ran it on my PC today, it could not > capture the overlay screen. Of course I used DirectX option(i. e., > Input: DirectX).
A regular SnagIt 7.2 region or window capture gets the overlay surface on the XP SP2 machine I just tried it on.
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
Sorry for my 'so what?' posting and following ones.
I thought you are upset for some unknown (and not acceptable for me) reason and release anger to me when you posted 'DO NOT POST HERE'. It's because you wrote the keywords with all-capitals(which means yelling), and deliberately omitted 'please' and simple guidance which can be as short as your first reply.
Yes, I didn't read 'DO NOT POST HERE' article. I wondered through the Google for information, and decided to post the question on a relevant newsgroup which is not known to me since I didn't even know the question is related to DirectShow. I used Google to post the question. Google's interface is convenient enough to post an article to some newsgroup without forcusing on the newsgroup specifically.
Anyways, sorry. I hope that you didn't mean to offend me on your 'DO NOT POST HERE' article.
> As you have observed SnagIt can do it. AFAIK, the technique TechSmith is > using is unknown by anyone who has posted here thus far on this issue. I > would have spent some time researching in the Windows source code for you > if your attitude in the other group you posted to had been better. Maybe > you will learn something from this for the future.
Taeyun Kim wrote: > I think the viable solution for this is preventing > applications from > using hardware overlay. I've read that recent DirectShow > versions (VMR7, VMR9) do not use hardware overlay for > more flexible video > mixing (although it is not the default), so preventing > the use of > hardware overlay is not very harsh option for the users > nowadays, if > he/she want to capture the screenshot.
VR: uses overlay if possible otherwise falls back to GDI OM: always uses overlay VMR7: always uses overlay (DD7) VMR9: always uses D3D9
On XP/2003, default is VMR7, with fallback to VR. On all previous Windows versions, default is VR.
> But forcing users to arrange the slidebar on the hardware > acceleration > dialog is not very comportable option. But since the > overlay screen is > very limited resource and application give up and use GDI > or other > option when it cannot get an overlay screen, a screen > capture > application can actually disable overlay screen by > grabbing it itself > before any other application can get it. > This requires that screen capture application must run > before the > movie player, it is acceptable for my situation.
There are VGA cards that support 2 overlays (e.g. recent Matrox cards) so, if you're going this way, create as many overlays as you can until the creation fails to be sure the other application will not use one.
However, screen grabbing is slow and you forced the other application to use software rendering which usually degrades quality and is far slower than overlay usage, so you may have performance and quality issues.
In any case, this is not how I think SnagIt works.
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
> Sorry for my 'so what?' posting and following ones.
I appreciate and accept your apology. Not that we're perfect, but if you see the MVP designation in the MS newsgroups it means we have been awarded by MSFT for *helping* in the online community.
> I thought you are upset for some unknown (and not acceptable for me) > reason and release anger to me when you posted 'DO NOT POST HERE'. > It's because you wrote the keywords with all-capitals(which means > yelling), and deliberately omitted 'please' and simple guidance which > can be as short as your first reply.
The post's title is in all caps and I was quoting it. It is in all caps in the hope that people will notice it not because I enjoy 'shouting'. I am surprised you didn't see it before posting. I recommend you look at a few posts and responses in a newsgroup before posting in it. Often there is a FAQ or other announcement post like mine that may help you before you post.
I have tried a number of approaches to get people over to the active newsgroups. I wish it were easy for MSFT to just delete the retired ones but, from what I understand, there are a lot of steps to go through in a large organization such as theirs.
> I hope that you didn't mean to offend me on your 'DO NOT POST HERE' > article.
Why would I want to do that? :)
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
> I have tried a number of approaches to get people over to > the active newsgroups. I wish it were easy for MSFT to > just delete the retired ones but, from what I understand, > there are a lot of steps to go through in a large > organization such as theirs.
Beside internal issues, the public MS NNTP servers are linked to Usenet and, since MSFT does not own Usenet and has no control over it, it can not delete a newsgroup once it has been replicated on other NNTP servers. They can delete it from their servers but it will still live on the rest of the Usenet space.
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
>> I have tried a number of approaches to get people over to >> the active newsgroups. I wish it were easy for MSFT to >> just delete the retired ones but, from what I understand, >> there are a lot of steps to go through in a large >> organization such as theirs.
> Beside internal issues, the public MS NNTP servers are > linked to Usenet and, since MSFT does not own Usenet and has > no control over it, it can not delete a newsgroup once it > has been replicated on other NNTP servers. They can delete > it from their servers but it will still live on the rest of > the Usenet space.
There is an RFC procedure for requesting a global group deletion, but AFAIK, no Usenet host is required to honour it. I still see the same stupid dead groups that have existed since the dawn of usenet.
Chris P. [MVP] wrote: > There is an RFC procedure for requesting a global group > deletion, but AFAIK, no Usenet host is required to honour > it. I still see the same stupid dead groups that have > existed since the dawn of usenet.
There is no Usenet authority and no way to enforce rules since NNTP servers do not need any special priviledge to replicate the feed from other servers and there are really a lot of servers in the Usenet space, which makes it impossible to track them down and demand (with no real authority) that they comply to some request. Unless a new structured news space replaces Usenet, like it happened over time with IRC networks, that's the way it is.
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
> On 26 Apr 2005 20:53:08 -0700, Taeyun Kim wrote:
> > SnagIt (version 7.2.2) failed > > to capture the overlay screen on my PC. I've heared that SnagIt can do > > it on newsgroup, but when I ran it on my PC today, it could not > > capture the overlay screen. Of course I used DirectX option(i. e., > > Input: DirectX).
> A regular SnagIt 7.2 region or window capture gets the overlay surface on > the XP SP2 machine I just tried it on.
Then maybe you can use PrintScreen key and get the same result. That is, there is possibility that overlay surface was not used at that time. I've seen in some cases a movie player don't use overlay surface by some reason I don't know. The case varies on different video cards and movie files. On my PC(XP SP2), a very short and low-quality avi file is played on GDI screen (or whatever else except for overlay surface), while a game's teaser movie is played on overlay surface.
BTW, I experienced a better software for screen capture. It is named 'Hypersnap'(...or is it? I tested it some time ago and uninstalled when evaluation period expired). It was required that it must be started before the movie player.
> > I think the viable solution for this is preventing > > applications from > > using hardware overlay. I've read that recent DirectShow > > versions (VMR7, VMR9) do not use hardware overlay for > > more flexible video > > mixing (although it is not the default), so preventing > > the use of > > hardware overlay is not very harsh option for the users > > nowadays, if > > he/she want to capture the screenshot.
> VR: uses overlay if possible otherwise falls back to GDI > OM: always uses overlay > VMR7: always uses overlay (DD7) > VMR9: always uses D3D9
> On XP/2003, default is VMR7, with fallback to VR. On all > previous Windows versions, default is VR.
> > But forcing users to arrange the slidebar on the hardware > > acceleration > > dialog is not very comportable option. But since the > > overlay screen is > > very limited resource and application give up and use GDI > > or other > > option when it cannot get an overlay screen, a screen > > capture > > application can actually disable overlay screen by > > grabbing it itself > > before any other application can get it. > > This requires that screen capture application must run > > before the > > movie player, it is acceptable for my situation.
> There are VGA cards that support 2 overlays (e.g. recent > Matrox cards) so, if you're going this way, create as many > overlays as you can until the creation fails to be sure the > other application will not use one.
> However, screen grabbing is slow and you forced the other > application to use software rendering which usually degrades > quality and is far slower than overlay usage, so you may > have performance and quality issues.
It's true. but at least it's better than disabling hardware excelleration as a whole. What makes me difficult is that it's best to capture whole screen with overlay screen normally merged to windowing system in my case. I can capture overlay surface separately and show two images - the one is normal fullscreen capture and the other is overlay surface to the users. But then I must explain the reason why there are two separate capture screens instead of one WYSIWYG capture screen to ordinary housewives.
> In any case, this is not how I think SnagIt works.
I agree with you. (since SnagIt fails to capture the movie screen on my machine...)
>> A regular SnagIt 7.2 region or window capture gets the overlay surface on >> the XP SP2 machine I just tried it on.
> Then maybe you can use PrintScreen key and get the same result. That > is, there is possibility that overlay surface was not used at that > time.
The overlay surface was in use (no video was captured from PrintScreen). As I wrote yesterday, I used the normal SnagIt window and region capture, not the DirectX capture.
> I've seen in some cases a movie player don't use overlay surface by > some reason I don't know. The case varies on different video cards and > movie files.
I used Media Player Classic for my tests. It has a good options panel for selecting which renderer to use including the old renderer and overlay mixer. The latter always uses the overlay. IIRC, it will error out if the overlay is not available.
> On my PC(XP SP2), a very short and low-quality avi file is played on > GDI screen (or whatever else except for overlay surface), while a > game's teaser movie is played on overlay surface.
Try Media Player Classic if you haven't already. It is a good app to have around for testing and for playing multimedia. Plus Gabest sometimes hangs around this newsgroup.
> BTW, I experienced a better software for screen capture. It is named > 'Hypersnap'(...or is it? I tested it some time ago and uninstalled > when evaluation period expired). It was required that it must be > started before the movie player.
I haven't found anything I can't do with SnagIt. It has a ton of options.
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
Taeyun Kim wrote: > I can capture overlay surface separately and show two > images - the one > is normal fullscreen capture and the other is overlay > surface to the > users. But then I must explain the reason why there are > two separate > capture screens instead of one WYSIWYG capture screen to > ordinary housewives.
You can always capture the screen bitmap and overlay surface separately then blit the captured overlay image onto the captured screen image in the right position, maybe taking into account the chromakey and clipping region it defines (but with videos this is usually a rectangle, so there is no need to worry).
I think this is what SnagIt does. I also think SnagIt must be started before the application using the overlay for the capture to work, just like HyperSnap and this is so because of the hack SnagIt (and most likely HyperSnap) uses to capture the overlay.
--
// Alessandro Angeli // MVP :: Digital Media // a dot angeli at psynet dot net
> On 27 Apr 2005 19:11:48 -0700, Taeyun Kim wrote:
> >> A regular SnagIt 7.2 region or window capture gets the overlay surface on > >> the XP SP2 machine I just tried it on.
> > Then maybe you can use PrintScreen key and get the same result. That > > is, there is possibility that overlay surface was not used at that > > time.
> The overlay surface was in use (no video was captured from PrintScreen). > As I wrote yesterday, I used the normal SnagIt window and region capture, > not the DirectX capture.
I also used the normal SnagIt window and region capture. But it failed to capture the content of overlay surface. (sigh) I also tried Media Player Classic, but result was the same: SnagIt could not capture the content od overlay surface. I wish I knew why.
> > I've seen in some cases a movie player don't use overlay surface by > > some reason I don't know. The case varies on different video cards and > > movie files.
> I used Media Player Classic for my tests. It has a good options panel for > selecting which renderer to use including the old renderer and overlay > mixer. The latter always uses the overlay. IIRC, it will error out if the > overlay is not available.
> > On my PC(XP SP2), a very short and low-quality avi file is played on > > GDI screen (or whatever else except for overlay surface), while a > > game's teaser movie is played on overlay surface.
> Try Media Player Classic if you haven't already. It is a good app to have > around for testing and for playing multimedia. Plus Gabest sometimes hangs > around this newsgroup.
> > BTW, I experienced a better software for screen capture. It is named > > 'Hypersnap'(...or is it? I tested it some time ago and uninstalled > > when evaluation period expired). It was required that it must be > > started before the movie player.
> I haven't found anything I can't do with SnagIt. It has a ton of options.
> -- > Please read this before replying: > 1. Dshow & posting help: http://tmhare.mvps.org/help.htm > 2. Trim & respond inline (please don't top post or snip everything) > 3. Benefit others: follow up if you are helped or you found a solution
On Thu, 28 Apr 2005 01:54:07 -0700, Taeyun Kim wrote: >> The overlay surface was in use (no video was captured from PrintScreen). >> As I wrote yesterday, I used the normal SnagIt window and region capture, >> not the DirectX capture.
> I also used the normal SnagIt window and region capture. > But it failed to capture the content of overlay surface. (sigh) > I also tried Media Player Classic, but result was the same: SnagIt could not > capture the content od overlay surface. > I wish I knew why.
I have SnagIt in my Windows start up programs. I don't know if that makes any difference.
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
I've read some part of DirectShow document without finding an acceptable method. Since I'm totally new to DirectShow(and DirectX), it is hard for me to know which COM interface or API is for my situation. Maybe the simplest solution is just calling IGraphBuilder::RenderFile() with an adequate movie file, but it is not acceptable since it requires a movie file and does more work than needed and thus over-consume system resource.
"Alessandro Angeli [MVP::DigitalMedia]" wrote: > Taeyun Kim wrote:
> > I think the viable solution for this is preventing > > applications from > > using hardware overlay. I've read that recent DirectShow > > versions (VMR7, VMR9) do not use hardware overlay for > > more flexible video > > mixing (although it is not the default), so preventing > > the use of > > hardware overlay is not very harsh option for the users > > nowadays, if > > he/she want to capture the screenshot.
> VR: uses overlay if possible otherwise falls back to GDI > OM: always uses overlay > VMR7: always uses overlay (DD7) > VMR9: always uses D3D9
> On XP/2003, default is VMR7, with fallback to VR. On all > previous Windows versions, default is VR.
> > But forcing users to arrange the slidebar on the hardware > > acceleration > > dialog is not very comportable option. But since the > > overlay screen is > > very limited resource and application give up and use GDI > > or other > > option when it cannot get an overlay screen, a screen > > capture > > application can actually disable overlay screen by > > grabbing it itself > > before any other application can get it. > > This requires that screen capture application must run > > before the > > movie player, it is acceptable for my situation.
> There are VGA cards that support 2 overlays (e.g. recent > Matrox cards) so, if you're going this way, create as many > overlays as you can until the creation fails to be sure the > other application will not use one.
> However, screen grabbing is slow and you forced the other > application to use software rendering which usually degrades > quality and is far slower than overlay usage, so you may > have performance and quality issues.
> In any case, this is not how I think SnagIt works.
> --
> // Alessandro Angeli > // MVP :: Digital Media > // a dot angeli at psynet dot net
Taeyun Kim wrote: > Then, how can I grab the overlay surface?
If by "grab the overlay surface" you mean create it so that it is not available for orthers, see the "Using Overlay Surfaces" tutorial in the DirectX 7.x SDK. The SDK is no longer available for download from MSFT so you need to either find a copy on the web or, if you have an MSDN subscription since long enough, find it on an old MSDN CD. Otherwise you can read it online:
> If by "grab the overlay surface" you mean create it so that > it is not available for orthers, see the "Using Overlay > Surfaces" tutorial in the DirectX 7.x SDK.
I think the OP means get the contents of the overlay surface. I'm going to guess your theory goes something like this:
- write a utility app that starts before the program that want to capture from
- in the utility app use the Detours library (from MSR) to trace all calls into the DirectDraw surface creation and manipulation methods
- examine these parameters to determine which is the overlay surface (will require some sleuthing)
- once you determine which is the overlay surface cache its id and any other required data (location, dimensions, bitdepth, etc.)
- for a commercial app you cannot use Detours so implement proprietary DLL hooking
Am I anywhere near the mark, Master? <g>
-- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution