Click here to Skip to main content
15,745,574 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to capture/record desktop activities as video using wpf
i getting a solution[^] using WME encoders in c# but it getting error Retrieving the COM class factory for component with CLSID {632B606A-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154. in my system has x64 bit.
Can anyone help me on what has to be done.
Thanks in Advance
[no name] 22-Aug-13 7:36am    
You would need to register the COM component.
Rakesh Bairi 26-Aug-13 5:10am    
after registration also i m getting same error

1 solution

Maybe it would be easier to capture the desktop at interval rates, and then encode each image into a video file using a plugin or an external library.

Check those:[^]

A Simple C# Wrapper for the AviFile Library[^]

About how to capture your destop, it's easy. You create a bitmap with the size of the screen, then a Graphics from the bitmap, and then copy the screen and save it:

private void TakeScreenShot()
    Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);

    Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);

    gfxScreenshot.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);

    //Change the ImageFormat to jpeg to save hard disk or keep it in Tiff
    //for higher resolution
    bmpScreenshot.Save("Dependencies\\temp.tif", ImageFormat.Tiff);
    bmpScreenshot = null;

You can adictionally use an external program like VirtualDub. Maybe you can make a script for it, and run it from your program. I know this is not the way you're intended to do it, but it's another way.
Share this answer
Rakesh Bairi 26-Aug-13 5:10am    
Thanks for your reply,i am looking for direct capture as video not image because we need to capture lots of images per second and combine it to video.
Magnus9998 26-Aug-13 8:19am    
The problem is that you can't capture directly as video. Every video capture software, including professional video recording, capture still images and store them in a temporary folder, then merge them into a temporary file and, finally, merge all images and encode them into the final video file. Have in mind that a video is just that, a bunch of still images and audio merged into a single file.
Rakesh Bairi 27-Aug-13 1:49am    
OK... Thanks I will try with your solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900