views:

78

answers:

0

Hello everyone,

I am using the following code to record screen, but the recorded video quality is not very good. Any ideas how to improve it?

My environment: Windows Vista + Windows Media Encoder + VSTS 2008 + C#.

Here is the original desktop screen snapshot,

http://i40.tinypic.com/zmxm6b.jpg

Here is the recorded desktop screen snapshot,

http://i42.tinypic.com/9ia5mx.jpg

My code,

IWMEncSourceGroup SrcGrp;
IWMEncSourceGroupCollection SrcGrpColl;
SrcGrpColl = encoder.SourceGroupCollection;
SrcGrp = (IWMEncSourceGroup)SrcGrpColl.Add("SG_1");

IWMEncVideoSource2 SrcVid;
IWMEncSource SrcAud;
SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);

SrcVid.SetInput("ScreenCap://ScreenCapture1", "", "");
SrcAud.SetInput("Device://Default_Audio_Device", "", "");

// Specify a file object in which to save encoded content.
IWMEncFile File = encoder.File;
string CurrentFileName = Guid.NewGuid().ToString();
File.LocalFileName = CurrentFileName;
CurrentFileName = File.LocalFileName;

// Choose a profile from the collection.
IWMEncProfileCollection ProColl = encoder.ProfileCollection;
IWMEncProfile Pro;
for (int i = 0; i < ProColl.Count; i++)
{
    Pro = ProColl.Item(i);

    if (Pro.Name == "Screen Video/Audio High (CBR)")
    {
        SrcGrp.set_Profile(Pro);
        break;
    }
}
encoder.Start();

thanks in advance, George

EDIT1: I have tried to use Windows Media Encoder screen recording (high quality mode), the same result -- i.e. the quality is not very good. I am using Windows Media Encoder 9.