Share via


Displaying Pages from the Session Properties and Monitor Panels

Windows Media Encoder SDK banner art

Rather than displaying the entire Windows Media Encoder UI, you can display specific pages.

Note   Previous versions of Windows Media Encoder must be upgraded to Windows Media Encoder 9 Series.

The Session Properties panel is used to configure the encoding session, and can display the following pages.

Page name Page object Description
Sources WMEncSourcesAltPage
WMEncSourcesPage
Defines the sources and source groups for an encoding session.
Output WMEncOutputPage Specifies the way encoded content is output (pushed to a Windows Media server, pulled from the encoding computer, and/or saved to a file).
Compression WMEncProfilePage Specifies the profile settings, including the codec and bit rate of the output streams.
Video Size WMEncVideoSizePage Specifies the settings for resizing video output.
Attributes WMEncAttributesPage
WMEncDisplayInfoPage
Specifies display information and attributes (name-value pairs) that provide extra information about the encoded content.
Processing WMEncProcessingPage Specifies the optimization settings for video and audio.
Plug-ins WMEncPluginsPage Specifies the transform plug-ins to use.
Security WMEncDRMPage Specifies the settings for protecting and watermarking encoded content.
Advanced WMEncAdvancedPage Displays the name of the current instance of Windows Media Encoder, and the settings for packet size, time code, and temporary storage.

The Monitor panel displays feedback and statistics during the encoding process, and can display the following pages.

Page Property Description
General WMEncMonMainPage Displays information about the current encoding session, including progress and system data.
Connections WMEncMonConnectionsPage Displays the number of clients connected to the encoding computer and connection URLs.
Display information WMEncMonDisplayInfoPage Displays the title, author, copyright, rating, and description values specified in the content.

To display property pages, create a generic property page container using the Microsoft PropShell ActiveX control. Each of the property pages can be independently created and added to the property page container using the AddPage method of the IMSPropShell interface or the MSPropShell object.

Each of the property pages can be independently created and added to the property page container using methods included in this object.

The following examples show how to display predefined property pages from Windows Media Encoder. For end-to-end code examples, see Complete Code Examples.

Visual Basic Example

The following example recreates the Session Properties panel from Windows Media Encoder. Begin by adding a PropShell ActiveX control to the form and call it PropPageShell.

To add the PropShell control to a form

  1. On the Project menu, click Components, select Microsoft PropShell Control 1.0, and then click OK.
  2. From the Toolbox, select the control and draw it on the form.
' Declare variables.
  Dim Encoder As WMEncoder
  Dim PpgSources As New WMEncSourcesPage
  Dim PpgOutput As New WMEncOutputPage
  Dim PpgProfile As New WMEncProfilePage
  Dim PpgVideo As New WMEncVideoSizePage
  Dim PpgAttr As New WMEncAttributesPage
  Dim PpgProc As New WMEncProcessingPage
  Dim PpgPlugs As New WMEncPluginsPage
  Dim PpgSec As New WMEncDRMPage
  Dim PpgAdv As New WMEncAdvancedPage

' Create the WMEncoder object.
  Set Encoder = New WMEncoder

' Add the WMEncoder object to the property page container (you must do
' this before adding the property pages to it).
  PropPageShell.AddObject Encoder

' Add the property pages to the property page shell.
  PropPageShell.AddPage PpgSources
  PropPageShell.AddPage PpgOutput
  PropPageShell.AddPage PpgProfile
  PropPageShell.AddPage PpgVideo
  PropPageShell.AddPage PpgAttr
  PropPageShell.AddPage PpgProc
  PropPageShell.AddPage PpgPlugs
  PropPageShell.AddPage PpgSec
  PropPageShell.AddPage PpgAdv

Once the encoding session properties have been specified, set them into the WMEncoder object and begin encoding as follows:

  PropPageShell.Apply
  Encoder.Start

C++ Example

// Include libraries.
#include <windows.h>
#include "mspropshell.h"
#include "wmencode.h"

// Declare variables.
    HRESULT hr = S_OK;
    IWMEncoder* pEncoder = NULL;
    IUnknown* pPpgSources = NULL;
    IMSPropShell* pMSPShell = NULL;

// Initialize the COM library and retrieve a pointer
// to an IWMEncoder interface.
    hr = CoInitialize(NULL);
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_WMEncoder,
                          NULL,
                          CLSCTX_INPROC_SERVER,
                          IID_IWMEncoder,
                          (void**) &pEncoder);
    }

// Create a property page.
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance( CLSID_WMEncSourcesPage,
                           NULL,
                           CLSCTX_INPROC_SERVER,
                           IID_IUnknown,
                           (void**) &pPpgSources);
    }

// Create the property page shell.
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_MSPropShell,
                          NULL,
                          CLSCTX_INPROC_SERVER,
                          IID_IMSPropShell,
                          (void**) &pMSPShell);
    }

// Add the Encoder object to the property page container.
    if ( SUCCEEDED( hr ) )
    {
        hr = pMSPShell->AddObject(pEncoder);
    }

// Add the property page(s) to the property page container.
    if ( SUCCEEDED( hr ) )
    {
        hr = pMSPShell->AddPage(pPpgSources);
    }

    // Release pointers.
    if ( pPpgSources )
    {
        pPpgSources->Release();
        pPpgSources = NULL;
    }
    if ( pMSPShell )
    {
        pMSPShell->Release();
        pMSPShell = NULL;
    }
    if ( pEncoder )
    {
        pEncoder->Release();
        pEncoder = NULL;
    }

See Also