Transitioning from the Windows Media Encoder SDK

Windows Media Encoder (WME) enhanced the ability of developers to work with multimedia. Microsoft Expression Encoder 4 further expands that ability by offering more features and a greater range of supported media types. This purpose of this topic is to help current users of the WME SDK transition to the Expression Encoder SDK.

If you are new to working with managed code like Visual Basic and C# and want more information, see An Overview of Managed/Unmanaged Code Interoperability Ff724699.xtlink_newWindow(en-us,Expression.40).png.

For more information about creating user interfaces with Windows Presentation Foundation (WPF), see the Windows Presentation Foundation Ff724699.xtlink_newWindow(en-us,Expression.40).png site.

Feature comparison between Windows Media Encoder 9 and Expression Encoder 4

The following table outlines the feature differences between Windows Media Encoder 9 and Expression Encoder 4.

Feature Windows Media Encoder 9 Expression Encoder 4

Captions

Supported.

Expanded support.

Device Capture

Supported.

Supported.

Digital Rights Management (DRM)

Supported.

Expanded support only in Expression Encoder Pro.

Encoding for Microsoft Silverlight

Not supported.

Supported.

H.264 Encoding Support

Not supported.

Supported only in Expression Encoder Pro, with the exception of the DreamSpark and MSDN versions of Expression Encoder Pro.

IIS Smooth Streaming

Not supported.

Supported.

Live Encoding

Supported.

Supported.

Live IIS Smooth Streaming

Not supported.

Supported only in Expression Encoder Pro.

Multi-Stream Encoding

Supported.

Supported.

Overlays

Supported.

Expanded support.

Pre-Processing

Supported.

Expanded support.

Screen Capture

Supported.

Expanded support.

Smart Encoding

Not supported.

Supported.

Working with Apple QuickTime Media

Not supported.

Supported.

Working with VC-1 codecs

Supported only in the 64-bit version of WME.

Supported.

Job types in Expression Encoder

An Expression Encoder job is roughly equivalent to a WME object. Unlike in WME, in Expression Encoder, the type of job specifies what function you can perform. There are three types of jobs: Job, LiveJob, and ScreenCaptureJob.

For more information about jobs, see the Expression Encoder User Guide.

Jobs in Expression Encoder

A Job is a set of one or more media files that you want to transcode. You can encode each with individual settings or declare one setting for the entire job. When working with media items, you can add overlays, trim the length, add clips, resize, crop, add templates, and more.

Job methods

The following list contains some of the most common methods that you will use with a Job in Expression Encoder:

  • ApplyPreset()   Allows you to set a preset for encoding. You can use either the presets included with the SDK or custom presets.

  • CancelEncode()   Cancels an encoding in progress.

  • Dispose()   Cleans up the resources used in initializing the job.

  • Encode()   Starts the encoding of all media items that have been added to a job.

Job members

The following list contains some of the more commonly used data members for a Job in Expression Encoder:

  • CreateSubFolder   Sets a Boolean value that specifies whether to create a subfolder in the output directory.

  • EncodeProgress   Displays the progress of the job. EncodeProgress is an EventHandler.

  • MediaItems   Lists all the media items that are in the current job.

  • OutputDirectory   Sets the full path of the directory where encoded files are saved.

Job Visual Basic code sample

The following table displays the differences between writing Job code using the Windows Media Encoder SDK and writing Job code using the Expression Encoder SDK.

Windows Media Encoder SDK Expression Encoder SDK
Dim Encoder As WMEncoder = New WMEncoder()
Dim SrcGrpColl As IWMEncSourceGroupCollection = Encoder.SourceGroupCollection
Dim SrcGroup As IWMEncSourceGroup2 = SrcGrpColl.Add("Encode")
Dim SrcVideo As IWMEncVideoSource2 = SrcGroup.AddSource(WMENC_VIDEO)
SrcVideo.SetInput = "c:\video.wmv"
SrcGroup.Profile = Encoder.ProfileCollection(PROFILE_NUMBER)
Encoder.File.LocalFileName = "c:\outVideo.wmv"
Encoder.Start()
Dim MyJob As New Job()
Dim Media As New MediaItem("c:\video.wmv")
Media.OutputFileName = "outVideo.wmv"
MyJob.MediaItems.Add(Media)
MyJob.OutputDirectory = "c:\output"
MyJob.Encode()

LiveJobs in Expression Encoder

You can use a LiveJob to capture live images from devices such as webcams and combine those images with saved file sources to create a live broadcast. As you broadcast, you can switch to various device sources. You can set each file source, after it has played back, to loop, to cut to another file source, or to freeze at the last frame. You can push your broadcast to a server publishing point, or you can broadcast from a local port. You can also choose to save your broadcast to disk for playback later.

For more information about Live Broadcasting, see the Expression Encoder User Guide.

LiveJob methods

The following list contains some of the most common methods that you will use with a LiveJob in Expression Encoder:

  • ActivateSource()   Sets the device or media item with which you want to begin the broadcast. This must be set before you begin encoding.

  • AddDeviceSource()   Adds a live capture device, such as a webcam, to the job.

  • AddFileSource()   Adds a media file to the job.

  • StartEncoding()   Starts encoding. LiveJobs continue encoding until you exit the program or until you execute the StopEncoding command.

  • StopEncoding()   Ends the encoding session.

LiveJob members

The following list contains some of the more commonly used data members for a LiveJob in Expression Encoder:

  • DeviceSources   Lists all the devices, such as webcams, that are currently part of the job.

  • FileSources   Lists all the media files that are currently in the job. You can choose one of three actions for each file source to take after it has played:

    • Hold   Freezes at the final frame.

    • Loop   Plays the media continuously.

    • Jump   Plays another specified file.

  • NumberOfDroppedSamples   Displays the total number of video samples that have been dropped since you began encoding.

LiveJob Visual Basic code sample

The following table displays the differences between writing LiveJob code using the Windows Media Encoder SDK and writing LiveJob code using the Expression Encoder SDK.

Windows Media Encoder SDK Expression Encoder SDK
Dim Encoder As WMEncoder = New WMEncoder()
Dim SrcGrpColl As IWMEncSourceGroupCollection = Encoder.SourceGroupCollection
Dim SrcGroup As IWMEncSourceGroup = SrcGrpColl.Add("Broadcast")
Dim VideoSource As IWMEncSource = SrcGroup.AddSource(WMENC_VIDEO)
VideoSource.SetInput = "c:\video.wmv"
SrcGroup.Profile = Encoder.ProfileCollection(PROFILE_NUMBER)
Encoder.Broadcast.PortNumber(WMENC_PROTOCOL_HTTP) = 8080
Encoder.Start()
Dim MyJob As New LiveJob()
Dim Media As MyJob.AddFileSource("c:\video.wmv")
MyJob.ActivateSource(Media)
Dim Broadcast As PullBroadcastPublishFormat = new PullBroadcastPublishFormat()
Broadcast.BroadcastPort = 8080
MyJob.PublishFormats.Add(Broadcast)
MyJob.StartEncoding()

ScreenCaptureJobs in Expression Encoder

You can use ScreenCaptureJobs to capture audio and video directly from your screen, or from a device such as a webcam. With this type of job, you can set the area of the screen and the audio sources that you want to capture.

ScreenCaptureJob methods

The following list contains some of the most common methods that you will use with a ScreenCaptureJob in Expression Encoder:

  • AddAudioDeviceSource()   Adds a specific audio capture source to the screen capture.

  • Pause()   Suspends capturing. You can stop or resume capture from this point.

  • Start()   Begins capturing from your screen or the device.

ScreenCaptureJob members

The following list contains some of the more commonly used data members for a ScreenCaptureJob in Expression Encoder:

  • CaptureMouseCursor   Sets a Boolean value for including the pointer in the screen capture.

  • CaptureRectangle   Gets or sets the capture range. The default is full-screen.

  • ScreenCaptureAudioProfile   Sets the audio encoding profile for the capture.

  • ScreenCaptureVideoProfile   Sets the video encoding profile for the capture.

ScreenCaptureJob Visual Basic code sample

The following table displays the differences between writing ScreenCaptureJob code using the Windows Media Encoder SDK and writing ScreenCaptureJob code using the Expression Encoder SDK.

Windows Media Encoder SDK Expression Encoder SDK
Dim Encoder As WMEncoder = New WMEncoder()
Dim SrcGrpColl As IWMEncSourcGroupCollection = Encoder.SourceGroupCollection
Dim SrcGroup As IWMEncSourceGroup = SrcGrpColl.Add("Capture")
Dim VideoSrc As IWMEncVideoSource = SrcGroup.AddSource(WMENC_VIDEO)
VideoSrc.SetInput = "ScreenCap://ScreenCapture1"
Encoder.Start()
Dim MyJob As ScreenCaptureJob = New ScreenCaptureJob()
MyJob.OutputPath = "c:\output"
MyJob.Start()

   © 2011 Microsoft Corporation. All rights reserved.