locked
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.

    --Sridhar

    Monday, May 3, 2010 9:54 AM

Answers

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.
                    SrcVid.SetInput("ScreenCap://ScreenCapture1");
                    Pro.LoadFromFile(@"C:\Inetpub\wwwroot\Profiles\schi.prx");
                    Pro.CompatibilityMode = WMENC_PROFILE_COMPATIBILITY.WMENC_ENCODER_V9;

                    // Choose a profile from the collection.
                    IWMEncProfileCollection ProColl;
                    SrcGrp.set_Profile((IWMEncProfile)Pro);

                    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.
                    Encoder.Start();

    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:

        http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/c78d9b6e-2da2-42d9-8cde-606a498522fb

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

        http://answers.microsoft.com/en-us/windows/default.aspx

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

       
    http://www.microsoft.com/windows/windowsmedia/community/newsgroups/WindowsMedia/default.mspx?dg=microsoft.public.windowsmedia.sdk

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

        http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.win32.programmer.mmedia

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

        http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.development.device.drivers

    For Silverlight questions, including developer ones:

        http://silverlight.net/forums/

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

        http://thegreenbutton.com/forums/

    For DirectX SDK questions use these Microsoft forums:

        http://forums.xna.com/forums/default.aspx?GroupID=7

    For Microsoft Expression products there are forums here:

        http://expression.microsoft.com/en-us/cc182192.aspx

    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