What’s New in the Expression Encoder 3 SDK?

When Encoder 3 is installed we now install the API help file, intellisense files and the sample projects, so you’re ready to go with the SDK as soon as Encoder is installed. You will find a SDK link on the start menu that will take you to the folder from where you can find the samples (in C# and Visual Basic) and the help CHM file.

Live Encoding Support

I know a bunch of you have been waiting for this for a while now and you’ll be glad to see that V3 has full support for the Live mode of the application through the object model.


// Create a new LiveJob to begin broadcasting this file.
using (LiveJob job = new LiveJob())
    // Create a new file source from the file name we were passed in
   LiveFileSource fileSource = job.AddFileSource(@"C:\myvideo.wmv");

    // Set this source to Loop when finished
   fileSource.PlaybackMode = FileSourcePlaybackMode.Loop;

    // Make this source the active one

From the LiveJob object you can get a list of video and audio capture devices installed on the system and add them as sources as well. See the Microsoft.Expression.Encoder.Live namespace for further details and the new Live SDK sample that is installed.

Redesigned profile support with full support for H.264 customization.

In V3 we now have separate profile classes for each profile type. This way if you’re dealing with the Main H.264 video profile for instance you’ll just see the properties that pertain to that profile on the object. (Note that you need the full version of Encoder for H.264 support). Along with this you now specify the profiles within the OutputFormat property on the MediaItem.

Bitrate is specified by using one of the new bitrate classes, ConstantBitrate, VariableConstrainedBitrate, VariableUnconstrainedBitrate and VariableQualityBitrate. Again this is so that only the properties that make sense are exposed on the class. For example when using VariableConstrainedBitrate there is a PeakBitrate property but that property isn’t exposed on any of the other bitrate classes as it only applies to the variable constrained bitrate type.


MainVC1VideoProfile videoProfile = new MainVC1VideoProfile();
videoProfile.Bitrate = new ConstantBitrate(350);
videoProfile.Complexity = VideoComplexity.Fastest;
videoProfile.Size = new System.Drawing.Size(640, 480);

MediaItem item = new MediaItem(@"C:\myvideo.wmv");
item.OutputFormat = new WindowsMediaOutputFormat()
    VideoProfile = videoProfile

Smooth Streaming

The Encoder SDK supports encoding to the smooth streaming output format (when using the full version of Expression Encoder). The video profile class now has a streams property which is used to specify the details of each stream that you wish to encode. Smooth Streaming can be used when encoding to constant bitrate for VC-1 and H.264 and to variable constrained bitrate when using VC-1. Additionally when using VC-1 and variable constrained bitrate you can specify that the sizes of the streams should be automatically determined by the encoder based upon the content and the bitrate. In this case you specify the maximum width and height to use for each stream.


AdvancedVC1VideoProfile videoProfile = new AdvancedVC1VideoProfile();

// When you create a VideoProfile you'll get one stream by default.
// In this example remove that one as we’re going to explicity 
// add the three streams below.
    new VariableConstrainedBitrate(1450, 1600),
    new System.Drawing.Size(800, 600));
    new VariableConstrainedBitrate(1050, 1600),
    new System.Drawing.Size(640, 480));
    new VariableConstrainedBitrate(600, 1600),
    new System.Drawing.Size(400, 300));

// Use smooth streaming with automatically sized streams.
videoProfile.SmoothStreaming = true;
videoProfile.Streams.AutoSize = true;

Encoding Multiple Sources Together

In V2 you could essentially combine up to three sources by using the leader, main video and trailer. In V3 you can move past this limit and combine multiple sources into one by using the new Source class.


MediaItem item = new MediaItem("mymovie1.wmv");
item.Sources.Add(new Source("mymovie2.wmv"));
item.Sources.Add(new Source("mymovie3.avi"));
item.Sources.Add(new Source("mymovie4.wmv"));

File Information

There are new classes to help analyze an existing media file to determine information about its video streams and audio streams (in case the file has more than one).


AudioVideoFile source = new AudioVideoFile("myvideo.wmv");

If the source file does have more than one audio stream you can now specify which stream is used when encoding by setting the AudioStreamIndex property on the Source object.


item.Sources[0].AudioStreamIndex = 2;


For all the standard presets that are installed with the application we have specified pre-defined static instances for each one to make it easier to use in case you don’t want to set all the properties of the profiles individually.



If you look at the Presets Members in the SDK help file you’ll see all the options along with descriptions.

So there you have a quick introduction to some of the new changes and improvements to the Expression Encoder object model in version 3. You can check out the What’s New section in the SDK help file for further details and feel free to give us your feedback and ask questions either by adding a comment here or over in the Expression Encoder Forum

Comments (21)

  1. Rui Marinho says:

    Hello nice post, i started this week working with encoder 3. My goal is to live feed from my canon hv30 that plugs to my pc by firewire. I m not able to use in HDV format only in DV with the Encoder v3.0. Is it possible to go around this with the sdk ?

    Thank you in advance

    Rui Marinho

  2. Dean Rowe says:

    Sorry we have more work to do, to support HDV devices.



  3. steve says:

    I have seen some examples of sdk about encoding using source file such as MediaItem(@"C:UsersPublicVideosSample VideosBear.wmv"). I am interested to do screen capture with SDK, similar to the utility "Screen Capture" comes with the EE3, any sdk examples?


  4. Anonymuos says:

    Will you please clarify your support of the H.264 implementation like http://en.wikipedia.org/wiki/H.264#Software_encoder_feature_comparison? Does it support CABAC and full main profile?

  5. tt says:

    Can you point me to some documentation that shows me how to use live encoding with windows media server, such that, i can broadcast a live webcast from my laptops webcam?

    Great post, thanks!

  6. Praveen Mehta says:


    i use expression encoder 3 but my video encoding failed it gives me error msg "the audio profile settings do not match valid system profile"

    my os is window 2003 x86

  7. Dean Rowe says:

    Encoder doess support main profile and CABAC.



  8. Dean Rowe says:

    There is a Live sample which should hopefully get you started.



  9. Dean Rowe says:

    Windows Server 2003 doesn’t support Wma Professional so you’ll need to change the audio codec to regular Wma.



  10. Anonymuos says:

    Yes I understand but can you detail the H.264 support in the release notes or support document? Are SI and SP slices supported? Quantization scaling matrices? Predictive lossless coding? When do you intend to support High Profile?

  11. Keoz says:

    Hi if me as MSDN subscriber get this SDK could I just make software using this SDK and sell it? my client needs to buy the license to use my software? regards

  12. Jonathan Howard says:

    Does version 3 of the Encoder SDK support Screen Capture?

  13. gkgreek says:

    What happened to the  Silverlight Streaming Publishing Plug-in for Expression Encoder 2? It appears that the link has been removed. Can anyone post it or send it to me?


  14. Andrew says:

    Can I use the Encoder 3 SDK with asp.net so that I capture the screen and broadcast it live on my asp.net website?


  15. sergio says:


    is now possible, using expression Encoder 3 SDK, to capture and manipulate a streaming signal (for example from some decoder)?

    I’m working on a big business application and have to develop some procedure that swithces from a file source to streaming signal source……Is it now possible?


  16. pinoinfor says:

    i use expression encode sdk api from c#, in x86 server run excelent, but in x64 not work… I was reading about x64, ws2003 x64 etc..  incompatibility …

    my scenarios is pc develop windows 7 (x86), server windows server 2008 r2 (of course x64)…

    I installed (on my server 2008 r2) expression studio (encoder packet only) for verify if its work… and all working ok..

    my question, how i can use expression encoder api from .net over x64 plataform ?


    PD: sorry for my english i speek spanish

  17. Pradeep Kumar says:

    How can i feed bitmap and generate WMV file.

    Please anyone reply me the proper class and the member function to do so.


  18. Eric says:

    Does anybody know how I can create manifest files using SDK? Encode() does not create these or Setting.dat file.

  19. George says:

    Apparently you still cannot combine a wmv with no audio with a wma?!

    If the wmv HAS audio you can replace it with audio overlay. If it doesn't, audio overlay is inaccessible.

    It would seem NOT having audio in a wmv is the most logical reason to WANT to overlay/combine with a separate wma. Why is it not possible?

  20. Hese says:

    The first comment: "Hello nice post, i started this week working with encoder 3. My goal is to live feed from my canon hv30 that plugs to my pc by firewire. I m not able to use in HDV format only in DV with the Encoder v3.0. Is it possible to go around this with the sdk ?"

    Is this possible now?

  21. Al says:

    I cannot install the Expression Encoder 4 free sp2 on Windows XP. I can see the licensing agreement, but no buttons appear to accept or decline. Any ideas?