How to improve video quality?
I am using the following code snippets for screen recording and in most cases the recorded wmv file is clear enough, but for some part of the video it is not very clear (gray for some parts). I am recording ppt with full screen. I am using Windows Media Encoder 9.
Here is my code snippet,
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
a source to share
I would guess it is a problem with your profile or encoder settings, not with the code. If you use the default "Screen Video / Audio High (CBR)" profile in WME9, it uses a video bitrate of 250 Kbps, which is quite low. I would suggest creating a custom profile in the Windows Media Encoder Profile Editor utility. Something like that:
awesomesc.prx
Title: Awesome Screen Profile
Audio: WMA 9.2 CBR (32 kbps, 44 kHz, mono CBR)
Video: WMV 9 Screen quality VBR (video size Same as video input, frame rate 10 fps, key frame interval 3 sec., Video quality 90)
Then just change the code to match the custom profile name.
if (Pro.Name == "Awesome Screen Profile")
The encoder settings take a lot longer, but if you haven't changed the default, you should be fine.
The quality-based VBR algorithm can be quite impressive and will most likely result in unexpectedly low average bitrates, but if VBR won't work for your needs, you can use the Windows Media Encoder Profile Editor utility to import the schia.prx you use and adjust the settings to find a higher CBR bitrate that provides acceptable quality.
a source to share