How can I improve my code to improve video quality?

I am using the following code to use Windows Media Encoder for screen recording. I am using Windows Vista, the screen resolution is 1024 × 768, 32-bit. My problem is that the video can be recorded successfully, but when I play back the recorded video, the video quality is not very good - for example, the characters are very unclear. I'm wondering what parameters should I try to adjust to improve the quality of my 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

0


a source to share


1 answer


Video encoders use a specific kbps ratio to limit the size of the generated stream. The lower the kbps, the less detail you will get due to fewer coefficients from the DCT and higher 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 that uses 384 kbps, which is not very suitable for video with a resolution of 1024 * 768. You should try other profiles or set the bit rate you want.

+3


a source







All Articles