Hello everyone,
Is it easy to write some .Net code to record screen and audio (from computer mic), then output to an wmv file. Any reference code?
BTW: I searched all codes from WME SDK, no such sample code.
thanks! George
Hello everyone,
Is it easy to write some .Net code to record screen and audio (from computer mic), then output to an wmv file. Any reference code?
BTW: I searched all codes from WME SDK, no such sample code.
thanks! George
Microsoft and the content mafi^H^H^H^Hindustry are trying their best to make this impossible. You will be far better of searching for "open source screen audio capture" than browsing any officially supplied documentation/example code - I would be seriously surprised if Microsoft provided anything relevant.
Check out the SDK that's available for Techsmith Camtasia:
Camtasia is a full-screen desktop recording app with support for various video and audio sources, codecs, etc., and their SDK exposes this as an ActiveX control (which you can call from .NET quite happily).
There are DirectShow compatible filters for screen capture. Which will allow you to use any recording program to capture the screen content or write an application yourself in .NET (but its not easy).
The one I use is: http://www.hmelyoff.com/index.php?section=9
EDIT: I have don't have a sample or experience with the WME SDK. But I would recommend going the DirectShow route to avoid the requirement of having WME on the host system, the lack of support for it, and its just good to know DirectShow (or do it yourself) rather than some random API.
To use the Hmelyoff filter, it works just like a webcam. Its just another video capture source available to any application that wants video input. It works by just copying the part of the viedo buffer to it's output pin on each frame (using a API function like BitBlt).
Some sample code is here.
Or if you want to just interface to DirectShow, the easiest way is using a library to do the COM interaction for you. http://directshownet.sourceforge.net/ is a good one.
EDIT again: Capturing as video is the same as capturing frames. It just captures frames 30 times a second. CPU hog? It is, don't expect to get the full framerate.
If what you are asking is how to save the frames as video, then you are going to need to pass the data to a video encoder. You WILL need to interface to DirectShow to do this.