VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    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,
    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
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    I suspect the bitrate is too low. 384 kbps for that resolution is going to be an issue. I don't know how you control the profile settings, but you probably need a bitrate closer to 1200 - 1500 kbps to keep the quality up
    Read my blog here.
    Quote Quote  
  3. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Is there a profile of 1200-1500kps from Wnidows Media Encoder? I enumerate all but not found. Any ideas? Am I wrong?

    Originally Posted by guns1inger
    I suspect the bitrate is too low. 384 kbps for that resolution is going to be an issue. I don't know how you control the profile settings, but you probably need a bitrate closer to 1200 - 1500 kbps to keep the quality up
    Quote Quote  
  4. The profiles and Windows Media Profile Editor comes with WME9, there is a
    "Windows Media Video 9 for Local Area Network (768 Kbps)" profile that ships with it but it's easy to customize your own profiles (.prx file), by using the editor (dimensions, bitrate etc...). It's also possible that you didn't setup the screen dimensions properly (the profile defaults to 320x240). It also looks like you are using an older version (your profile references WME8, not WME9) you might consider upgrading

    I don't know how to implement this through code, only through the regular interface, but it looks like your code references the actual profile name so this should work in theory if you reference the modified profile
    [quote]
    (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)")
    [quote]


    I think I suggested this to you in another thread about streaming for tutorials, but you will get much better quality results using h.264 and flash. You could probably use 1/2 the bitrate that you would use for wmv, and the quality would still be better. Bandwidth costs money, and this is why most sites have adopted the h.264/aac format. And even MS has "caved in" and announced h264 support to Silverlight recently
    Quote Quote  
  5. Member Safesurfer's Avatar
    Join Date
    Mar 2004
    Location
    United States
    Search Comp PM
    Hi George:

    Couple of posts from the first page of comments from the http://www.codeproject.com/KB/audio-video/CaptureScreenAsVideo.aspx?display=PrintAll&f...=1160633#xx0xx site may be of use.

    how to improve quality? member ping_jacob 8:10 26 Jan '09

    i tested this application but so blur

    any text can't read

    how to improve?, config framrate?

    please give some hint or tip to me

    thanks a lot
    Answer Re: how to improve quality? member Armoghan Asif 0:43 28 Jan '09

    Change profile from
    Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)"
    to
    Pro.Name = Screen Video/Audio High (CBR)
    and,

    How do WMencoder Works member NiyaHere 23:13 19 Aug '08

    Hi,

    Have a small query...Pls tell me whether WMencoder saves the screen shots anywhere in the local machine? or is it directly creating the .wav file ?

    If it is creating temporary images/ screen shots , pls tell me where it is getting saved?

    And whether I can set the encoder to take a screen shot in every 2 seconds or so..

    Thanks in Advance

    Niya
    Answer Re: How do WMencoder Works member Armoghan Asif 23:51 19 Aug '08

    WMEncoder saves stream to the file directly, no temporary place saving.
    As it is saving video accoding to the profile, so you can set frames per second etc

    Create a new profile by running following exe
    C:\Program Files\Windows Media Components\Encoder\WMProEdt.exe
    and set its FrameRate, Video Bit rate etc
    General Re: How do WMencoder Works [modified] member NiyaHere 20:23 20 Aug '08

    Hi,

    Thanks for ur reply... Smile

    Could u pls tell me what will be the default frame rate for this? n How to set the same...

    n still m confused about setting the time interval, like i wanna capture screen shot every 2 seconds. how can i do that by code?

    Thanks

    Niya

    modified on Thursday, August 21, 2008 5:57 AM

    General Re: How do WMencoder Works member Armoghan Asif 19:42 24 Aug '08

    Hi
    you just have to change the following line

    Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)"

    with the new profile you make using the method present in my previous comment.

    Once you run the WMProEdt.exe and import pre existing profiles, you will get an idea how to set the framerate. You can make frame rate = 0.5 per second, should capture screen after two seconds.
    Might be worth reading through other posts too, but I found those in the first few comments.

    Hope this helps.
    "Just another sheep boy, duck call, swan
    song, idiot son of donkey kong - Julian Cope"
    Quote Quote  
  6. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Thanks Safesurfer,

    Your solution works -- to set the profile as screen recording high. There is a new issue which is related to Windows Media Encoder installation, it is appreciated if you could take a look and help to show your great ideas again!

    The new question is,

    https://forum.videohelp.com/topic367881.html#1966058

    Originally Posted by Safesurfer
    Hi George:

    Couple of posts from the first page of comments from the http://www.codeproject.com/KB/audio-video/CaptureScreenAsVideo.aspx?display=PrintAll&f...=1160633#xx0xx site may be of use.

    how to improve quality? member ping_jacob 8:10 26 Jan '09

    i tested this application but so blur

    any text can't read

    how to improve?, config framrate?

    please give some hint or tip to me

    thanks a lot
    Answer Re: how to improve quality? member Armoghan Asif 0:43 28 Jan '09

    Change profile from
    Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)"
    to
    Pro.Name = Screen Video/Audio High (CBR)
    and,

    How do WMencoder Works member NiyaHere 23:13 19 Aug '08

    Hi,

    Have a small query...Pls tell me whether WMencoder saves the screen shots anywhere in the local machine? or is it directly creating the .wav file ?

    If it is creating temporary images/ screen shots , pls tell me where it is getting saved?

    And whether I can set the encoder to take a screen shot in every 2 seconds or so..

    Thanks in Advance

    Niya
    Answer Re: How do WMencoder Works member Armoghan Asif 23:51 19 Aug '08

    WMEncoder saves stream to the file directly, no temporary place saving.
    As it is saving video accoding to the profile, so you can set frames per second etc

    Create a new profile by running following exe
    C:\Program Files\Windows Media Components\Encoder\WMProEdt.exe
    and set its FrameRate, Video Bit rate etc
    General Re: How do WMencoder Works [modified] member NiyaHere 20:23 20 Aug '08

    Hi,

    Thanks for ur reply... Smile

    Could u pls tell me what will be the default frame rate for this? n How to set the same...

    n still m confused about setting the time interval, like i wanna capture screen shot every 2 seconds. how can i do that by code?

    Thanks

    Niya

    modified on Thursday, August 21, 2008 5:57 AM

    General Re: How do WMencoder Works member Armoghan Asif 19:42 24 Aug '08

    Hi
    you just have to change the following line

    Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)"

    with the new profile you make using the method present in my previous comment.

    Once you run the WMProEdt.exe and import pre existing profiles, you will get an idea how to set the framerate. You can make frame rate = 0.5 per second, should capture screen after two seconds.
    Might be worth reading through other posts too, but I found those in the first few comments.

    Hope this helps.
    Quote Quote  
  7. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Thanks poisondeathray,

    Your suggestion works -- I solve my problem by setting the profile as screen recording high. There is a new issue which is related to Windows Media Encoder installation, it is appreciated if you could take a look and help to show your great ideas again!

    The new question is,

    https://forum.videohelp.com/topic367881.html#1966058

    [quote="poisondeathray"]The profiles and Windows Media Profile Editor comes with WME9, there is a
    "Windows Media Video 9 for Local Area Network (768 Kbps)" profile that ships with it but it's easy to customize your own profiles (.prx file), by using the editor (dimensions, bitrate etc...). It's also possible that you didn't setup the screen dimensions properly (the profile defaults to 320x240). It also looks like you are using an older version (your profile references WME8, not WME9) you might consider upgrading

    I don't know how to implement this through code, only through the regular interface, but it looks like your code references the actual profile name so this should work in theory if you reference the modified profile
    [quote]
    (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)")


    I think I suggested this to you in another thread about streaming for tutorials, but you will get much better quality results using h.264 and flash. You could probably use 1/2 the bitrate that you would use for wmv, and the quality would still be better. Bandwidth costs money, and this is why most sites have adopted the h.264/aac format. And even MS has "caved in" and announced h264 support to Silverlight recently
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!