3

I would like to take Skype's video and insert it into my own application. I am using skype4com to control the call, but I can find no reference or example which suggests a facility to get at its video stream to embed it in your application. I tried to join the SkypeKit program but a month later I'm still waiting for any word from them, and I hear you often just wait and wait to hear from them.

I was wondering if there's something else I can do, something as simple as finding the hwnd for the video Skype is displaying and use it in/for a panel/form/etc. that I own in my application, and then hide the rest of the Skype window. I tried Googling about the general topic but perhaps my lack of knowing the right description for the concept is preventing me from finding anything.

Crudely I know I could do something like use the window handle to grab a bitmap of the frame and show it in my own application, hiding Skype, but that would presumably be a lot of overhead.

Anyone know how to do this or what concept this represents so I can find it on my own?

Thanks!

1 Answer 1

3

This isn't the final or complete answer to the question, but it contains partial answers to the question I asked...

I ended up trying various things and had various degrees of success.

The first issue when tacking this sort of problem is apparently to determine if the video you are trying to re-purpose is rendered via DirectX or not.

If the video is NOT DirectX rendered then you can indeed capture video from a window and play it real time wherever you like. There are various samples on the web that should you how to capture bitmaps from a Window. The trick is that the Window can be invisible via opacity but cannot be minimized (minimized it will not update)! You just use the hwnd you find for the Window which has the video and in a loop just grab copies of those bitmaps via various methods and then show them as you want elsewhere. Depending on your computer's speed and the size of the video this method works tolerably, I had no problems.

If the video you are trying to hijack is rendered via DirectX then you are mostly, but not entirely, out of luck. Because DirectX video is rendered by the graphics card (not the OS) directly onto an OS surface you have to use a totally different approach to grab the video as frames and show them elsewhere. There are various examples of how to do DirectX screen capture. The massive problem, though, is that if the DirectX window is hidden, overlapped, or has its opacity set to zero you will not capture anything! I even tried using a virtual desktop manager software to see if I could trick the system into playing the DirectX video in a virtual window and then capture that to play where I wanted, but of course it is smarter than I am and I got a blank image. So, bottom line seems to be unless you do something really extreme like write a virtual graphics card driver you're out of luck. (There are various interest methods which involve writing DirectX proxies that could capture video/stills on their way to the graphics card but I still think you might need a virtual graphics driver to convince it that the display surface is visible and thus worth rendering.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.