Blank screen captured while using Windows Media Encoder 9 in WCF RRS feed

  • Question

  • Hi All.

    I have a Silverlight application which captures the screen and saves it as a .wmv file. As I cant directly reference the DLLs of WMEncoder, I have a WCF application which does the encoding process. I have a 'Start' and 'Stop' button in the Silverlight application and the buttons do the job pretty well. I get a .wmv file but when I open it, I just find a black blank screen. Am I missing something. Let me know if you need further info on this.

    Thanks in advance.


    Monday, May 3, 2010 9:54 AM


All replies

  • Hi All.

    In continuation with the above question, here is my code for Encoding

     // Create a WMEncoder object.
                    Encoder = new WMEncoder();
                    // Retrieve the source group collection and add a source group.

                    IWMEncSourceGroup SrcGrp;
                    IWMEncSourceGroupCollection SrcGrpColl;
                    IWMEncProfile2 Pro = new WMEncProfile2();

                    SrcGrpColl = Encoder.SourceGroupCollection;
                    SrcGrp = SrcGrpColl.Add("SG1");

                    // Add a video and audio source to the source group.
                    IWMEncVideoSource2 SrcVid ;
                    SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);

                    // Identify the source files to encode.
                    Pro.CompatibilityMode = WMENC_PROFILE_COMPATIBILITY.WMENC_ENCODER_V9;

                    // Choose a profile from the collection.
                    IWMEncProfileCollection ProColl;

                    ProColl = Encoder.ProfileCollection;

                    //Fill in the description object members.
                    IWMEncDisplayInfo Descr ;
                    Descr = Encoder.DisplayInfo;

                    Descr.Author = "XXXX

                    Descr.Copyright = "Copyright information";
                    Descr.Description = "Text description of encoded content";
                    Descr.Rating = "Rating information";
                    Descr.Title = "First Screen Capture";

                    // Specify a file object in which to save encoded content.
                    IWMEncFile File;
                    File = Encoder.File;
                    File.LocalFileName = "C:\\videoOutput\\OutputFile.wmv";

                     // Start the encoding process.

    Monday, May 3, 2010 10:37 AM
  • This forum is for Media Foundation Development.

    See this post at the top of the forum for resources for other multimedia forums and newsgroups:


    For Windows 7, Vista and XP questions, please post in the appropriate forum here:


    Windows Media SDK questions belong here (see the left pane of the page below for other WM categories including Player, Encoder and MovieMaker):


    General Windows multimedia questions (wav, Video for Windows, mmio,etc.) belong in this forum/newsgroup:


    The Windows Driver Kit (previously known as the DDK) has a forum/newsgroup on MSDN here:


    For Silverlight questions, including developer ones:


    The official Microsoft forums for Windows Media Center, including for developers, are:


    For DirectX SDK questions use these Microsoft forums:


    For Microsoft Expression products there are forums here:


    Unfortunately, my Moderator 'move thread' permissions do not extend to those forums.  Please read the posts at the top of the forums before posting.

    This thread is locked.  Please re-post in the appropriate forum or newsgroup.
    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Monday, May 3, 2010 12:56 PM