views:

265

answers:

1

Hello everyone,

I am using the following code to leverage Windows Media Encoder to record screen. I am using Windows Vista, screen resolution 1024 × 768, 32-bit. My issue is, the video could be recorded successfully, but when I playback the recorded video, the quality of video is not very good -- e.g. characters are very obscure. I am wondering what are the parameters I should try to tune to get better quality of recorder video?

My code,

            static WMEncoder encoder = new WMEncoder();

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

            IWMEncVideoSource2 SrcVid;
            SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
            SrcVid.SetInput("ScreenCap://ScreenCapture1", "", "");
            IWMEncFile File = encoder.File;
            File.LocalFileName = "C:\\OutputFile.avi";

            // 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 == "Windows Media Video 8 for Local Area Network (384 Kbps)")
                {
                    SrcGrp.set_Profile(Pro);
                    break;
                }
            }

        encoder.Start();

thanks in advance, George

+3  A: 

Video encoders use a certain kbit/second ratio to limit the size of the generated stream. The fewer kbits/sec the less detail you will get due to fewer coefficients from the DCT and bigger quantization values. In other words: the more kbits/sec you put into the video the more detail can be stored in the stream by the encoder.

Judging by your code you have chosen a profile which uses 384 kbit/s which is not very much for a 1024*768 video. You should try other profiles or set bitrate you want yourself.

Philipp
@emktas, any hints what kinds of profile do you suggest? I am not a video expert. :-)
George2
I think your suggestion is we could use higher kps video profile, correct? But please correct me if I am wrong, I did not find any higher kps video profile. :-(
George2
@emktas, I have tried and it works when I set higher kps, thanks!
George2