Expression Encoder

The team blog for Expression Encoder.

Posts
  • Expression Encoder

    Getting started with the Expression Encoder Object Model

    • 8 Comments

    (UPDATE: This post was written against the Beta of Expression Encoder v2. Now that the RTM version is out we recommend that you install that version and check out the RTM version of this post instead)

    (This post assume you’ve already installed Expression Encoder Beta 2 available from here, and that you have Visual Studio 2005 or 2008 installed.)

    First of all start Visual Studio and select File… New Project… You can choose which type of application you would prefer, like a WPF or Windows Forms application. For my test here, I’m just going to choose a Console Application. Give it a suitable name.

    image

    Go ahead and click OK.

    Before you can start coding against the Expression Encoder object model you need to add references to the applicable assemblies. Select Project…Add Reference from the menu. When the dialog comes up you need to select

    Microsoft.Expression.Encoder
    Microsoft.Expression.Encoder.Types
    Microsoft.Expression.Encoder.Utilites

    and because some of our types derive from ObservableCollection you also need to select

    WindowsBase.

    You can select them one at a time or hold down CTRL and multi-select each one before clicking OK.

    image

    Now we're ready to do some coding.

    To make it easier to pick up the Encoder classes let's first of all add a using statement. Just add the following near the top of the file where the other using statements are.

    using Microsoft.Expression.Encoder;

    One of the main classes that you'll end up dealing with in Expression Encoder is the MediaItem class. This allows you to find out information about a video or audio file and ultimately allow you to encode it. To create one of these you just pass the filename of the media file you want.to the constructor.

    e.g.
    MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");

    Obviously, you'll change the filename to the one you want to use.

    Once this has been created you'll be able to access a bunch of information about the file

    e.g.
    FileDuration
    OriginalAspectRatio
    OriginalVideoSize

    This is also the way you'll control how the video is encoded. If you type mediaItem followed by a "." you should trigger the Intellisense drop down which shows you all the properties and methods on this item. You should see a lot of properties that correspond to options in the UI of the main Encoder application.

    For now we'll just use the defaults.

    Before we can encode the file we need to create and add it to a Job.

    This is simply done by the following statements.

    Job job = new Job();
    job.MediaItems.Add(mediaItem);

    If you want to encode multiple files in the same job you can go ahead and create multiple MediaItem's and add them to the job.

    Before you encode you need to set the directory where the output will go. This is done by setting the OutputDirectory property.

    job.OutputDirectory = @"C:\output";

    By default Expression Encoder will create output in sub folders named using the Job Id. These will be something along the lines of your machine name followed by the current date and time, e.g. "DEAN 4-21-2008 11.00.47 PM".

    You can turn this feature off by setting the CreateSubfolder property.

    job.CreateSubfolder = false;

    Then the output will be created in the output directory directly.

    For the simplest case, that’s all you need before encoding the job. This is done by just calling the Encode method.

    job.Encode();

    Putting it all together your program should look something like this.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Expression.Encoder;
    
    namespace MyEncoderApplication
    {
        class Program
        {
            static void Main(string[] args)
            {
                MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");


    // Create a job and the media item for the video we wish // to encode.
    Job job = new Job(); job.MediaItems.Add(mediaItem);
                // Set the output directory and encode
                job.OutputDirectory = @"C:\output";
                job.Encode();
            }
        }
    }

    Now you should be able to compile and run the application. After it's finished running, you should have the encoded output file underneath the output directory. It should have a filename that matches the original, but with a .wmv file extension.

    If you run the application and it crashes, then that is probably because an exception was thrown that is not currently being caught. For example if your MediaItem points to a file that doesn't exist or isn't a valid media file, you will see that an InvalidMediaFileException is thrown. You can then run it under the debugger to get more details.

    Assuming everything worked OK then for your next step you'll probably want to show some progress during the encode. First of all you need to a add a progress event handler function. Something like the following

    static void OnProgress(objectsender, PublishProgressEventArgs e)
    {
        Console.WriteLine(e.Progress);
    }

    Obviously here we're just dumping the progress to the screen on each line. If you were writing a GUI app you would probably update a progress bar or something similar.

    To tell Encoder to call this function you need the following line when you're creating the job.

    job.PublishProgress +=
        new EventHandler<PublishProgressEventArgs>(OnProgress);

    Now you’re code should look something like the following.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Expression.Encoder;
    
    namespace MyEncoderApplication
    {
        class Program
        {
            static void Main(string[] args)
            {
                MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");
     
                // Create a job and the media item for the video we wish 
                // to encode.
                Job job = new Job();
                job.MediaItems.Add(mediaItem);
    
                // Set up the progress callback function
                job.PublishProgress +=
                    new EventHandler<PublishProgressEventArgs>(OnProgress);
    
                // Set the output directory and encode.
                job.OutputDirectory = @"C:\output";
                job.Encode();
            }
    
            static void OnProgress(object sender, 
                PublishProgressEventArgs e)
            {
                Console.WriteLine(e.Progress);
            }
        }
    }

    When you compile and run the application you should now see a bunch of numeric values going to 100, something like the following.

    clip_image002

    That’s it for a basic encoding app. From here you can now try experimenting with various properties on the MediaItem. For example, if you want to try tweaking the output profile, you can look at this post – Changing the output profile.

    UPDATE: If you’re running a 64-bit OS then you may also need to change your Target Platform within Visual Studio from “Any CPU” to "x86” as Expression Encoder is 32-bit.

  • Expression Encoder

    New Encoder build available (1651)

    • 6 Comments

    We have updated our build on the download center to resolve a couple of issues related to the screen capture application.  Some machines with Expresion Encoder 4 Pro were incorrectly limiting the screen capture time limit and we had an issue with XESC files being played back in the Windows Media Player on 64-bit Vista and Windows Server 2008.  

    In order to upgrade, simply grab the newest version of the free Encoder (available here) and install over the current one. The version number will go from 4.0.1639.0 to 4.0.1651.0. Note that there is no need to uninstall the older version, setup will upgrade it for you. Please also take note that those international versions already have the fixes mentioned above, so there is no need to upgrade them.

  • Expression Encoder

    SharePoint 2010 publish plugin released

    • 2 Comments

    Hi everyone, we just posted a publish plugin to upload your output directory to the new SharePoint 2010 Asset libraries.  Check it out:

    http://gallery.expression.microsoft.com/en-us/EESharePointPlugin?SRC=Home

    jamie

     

  • Expression Encoder

    Expression Encoder 2 SP1 is released

    • 13 Comments

    SP1 has just gone live here:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=A29BE9F9-29E1-4E70-BF67-02D87D3E556E&displaylang=en

    In addition to the enhancements that are documented in this post, the update includes support for the authoring of IIS Smooth Streaming content.

    Note that the authoring of both IIS Smooth Streaming and H.264 for devices are only available in the full product, not the trial.  The remainder of the features such as audio overlays and WebDAV publishing are available both in the trial and the full product.

  • Expression Encoder

    Expression Encoder 2 VB.NET update

    • 9 Comments

    We've just released an update to Expression Encoder 2 that allows VB.NET developers to build solutions using the Expression Encoder 2 SDK

    You can get the update here:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=8727DD51-61B3-4692-ABDE-4FDD2779B0D0&displaylang=en

    The cool part is that the update is only required on developer machines.  Any apps created in VB.NET on a machine with the fix will run against the unmodified Expression Encoder 2 release bits.

    Hope this helps

    James

  • Expression Encoder

    Video: Hello World

    • 30 Comments

    Welcome to the new Expression Encoder team blog!  As Charles says in the video, we plan on posting a bunch for hints and tips over the coming weeks.  We also encourage you to give us your feedback.

    All of our video blog posts are made with Expression Encoder and published using Silverlight on the Silverlight Streaming by Windows Live video hosting service.

    We are currently hard at work on the next release and look forward to sharing the details soon.  Thanks for watching / reading!

    The Expression Encoder Team

  • Expression Encoder

    Expression Encoder 2 SDK Released

    • 25 Comments

     

    Last week we released the Expression Encoder 2 SDK. Here's a little video of Charles and I, giving a quick introduction. Apologies for the rather close camera angle as Charles was just holding the camera with his left hand, and it didn't help that our makeup and wardrobe department was out that day.

    You can get it from the following location.

    Microsoft® Expression® Encoder 2 SDK

    Please try it out and don't hesitate to send us your feedback.

  • Expression Encoder

    New Silverlight Streaming Publishing plugin for Expression Encoder: Silverlight 2 support

    • 4 Comments

    We just released an update to the Silverlight Streaming publishing plugin to support the Silverlight 2 templates that were added in Expression Encoder 2 SP1.

    You can get it from the Download Center here.

    image

  • Expression Encoder

    Getting started with the Expression Encoder Object Model (RTM Version)

    • 11 Comments

    This post is an update to the previous Getting started with the Expression Encoder Object Model post, but updated to work with the RTM version of Expression Encoder V2 as the progress event handler changed a little from Beta to RTM.

    (This post assume you’ve already installed Expression Encoder V2 available from here, and that you have Visual Studio 2005 or 2008 installed.)

    First of all start Visual Studio and select File… New Project… You can choose which type of application you would prefer, like a WPF or Windows Forms application. For my test here, I’m just going to choose a Console Application. Give it a suitable name.

    image

    Go ahead and click OK.

    Before you can start coding against the Expression Encoder object model you need to add references to the applicable assemblies. Select Project…Add Reference from the menu. When the dialog comes up you need to select

    Microsoft.Expression.Encoder
    Microsoft.Expression.Encoder.Types
    Microsoft.Expression.Encoder.Utilites

    and because some of our types derive from ObservableCollection you also need to select

    WindowsBase.

    You can select them one at a time or hold down CTRL and multi-select each one before clicking OK.

    image

    Now we're ready to do some coding.

    To make it easier to pick up the Encoder classes let's first of all add a using statement. Just add the following near the top of the file where the other using statements are.

    using Microsoft.Expression.Encoder;

    One of the main classes that you'll end up dealing with in Expression Encoder is the MediaItem class. This allows you to find out information about a video or audio file and ultimately allow you to encode it. To create one of these you just pass the filename of the media file you want.to the constructor.

    e.g.
    MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");

    Obviously, you'll change the filename to the one you want to use.

    Once this has been created you'll be able to access a bunch of information about the file

    e.g.
    FileDuration
    OriginalAspectRatio
    OriginalVideoSize

    This is also the way you'll control how the video is encoded. If you type mediaItem followed by a "." you should trigger the Intellisense drop down which shows you all the properties and methods on this item. You should see a lot of properties that correspond to options in the UI of the main Encoder application. If you want Intellisense comments to appear and want to check out the help file, see this post.

    For now we'll just use the defaults.

    Before we can encode the file we need to create and add it to a Job.

    This is simply done by the following statements.

    Job job = new Job();
    job.MediaItems.Add(mediaItem);

    If you want to encode multiple files in the same job you can go ahead and create multiple MediaItem's and add them to the job.

    Before you encode you need to set the directory where the output will go. This is done by setting the OutputDirectory property.

    job.OutputDirectory = @"C:\output";

    By default Expression Encoder will create output in sub folders named using the Job Id. These will be something along the lines of your machine name followed by the current date and time, e.g. "DEAN 4-21-2008 11.00.47 PM".

    You can turn this feature off by setting the CreateSubfolder property.

    job.CreateSubfolder = false;

    Then the output will be created in the output directory directly.

    For the simplest case, that’s all you need before encoding the job. This is done by just calling the Encode method.

    job.Encode();

    Putting it all together your program should look something like this.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Expression.Encoder;
    
    namespace MyEncoderApplication
    {
        class Program
        {
            static void Main(string[] args)
            {
                MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");


    // Create a job and the media item for the video we wish // to encode.
    Job job = new Job(); job.MediaItems.Add(mediaItem);
                // Set the output directory and encode
                job.OutputDirectory = @"C:\output";
                job.Encode();
            }
        }
    }

    Now you should be able to compile and run the application. After it's finished running, you should have the encoded output file underneath the output directory. It should have a filename that matches the original, but with a .wmv file extension.

    If you run the application and it crashes, then that is probably because an exception was thrown that is not currently being caught. For example if your MediaItem points to a file that doesn't exist or isn't a valid media file, you will see that an InvalidMediaFileException is thrown. You can then run it under the debugger to get more details.

    Assuming everything worked OK then for your next step you'll probably want to show some progress during the encode. First of all you need to a add a progress event handler function. Something like the following

    static void OnProgress(object sender, EncodeProgressEventArgs e)
    {
        Console.WriteLine(e.Progress);
    }
    

    Obviously here we're just dumping the progress to the screen on each line. If you were writing a GUI app you would probably update a progress bar or something similar.

    To tell Encoder to call this function you need the following line when you're creating the job.

    job.EncodeProgress 
        += new EventHandler<EncodeProgressEventArgs>(OnProgress);
    

    Now you’re code should look something like the following.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Expression.Encoder;
    
    namespace MyEncoderApplication
    {
        class Program
        {
            static void Main(string[] args)
            {
                MediaItem mediaItem = new MediaItem(@"C:\input\video.avi");
    
                // Create a job and the media item for the video we wish
                // to encode.
                Job job = new Job();
                job.MediaItems.Add(mediaItem);
    
                // Set up the progress callback function
                job.EncodeProgress 
                    += new EventHandler<EncodeProgressEventArgs>(OnProgress);
    
                // Set the output directory and encode.
                job.OutputDirectory = @"C:\output";
                
                job.Encode();
            }
    
            static void OnProgress(object sender, EncodeProgressEventArgs e)
            {
                Console.WriteLine(e.Progress);
            }
        }
    }
    
    

    When you compile and run the application you should now see a bunch of numeric values going to 100, something like the following.

    clip_image002

    That’s it for a basic encoding app. From here you can now try experimenting with various properties on the MediaItem. For example, if you want to try tweaking the output profile, you can look at this post – Changing the output profile.

    Note that if you’re running a 64-bit OS then you may also need to change your Target Platform within Visual Studio from “Any CPU” to "x86” as Expression Encoder is 32-bit.

  • Expression Encoder

    Expression Encoder 2 SDK Updated for Service Pack 1

    • 10 Comments

    image We’ve just released an update to the SDK, which now incorporates the new features in Expression Encoder 2 Service Pack 1.

    Here are the main things that are new in the SDK :-

  • We’ve improved the formatting of the help file so things are hopefully a little easier to read.

  • We have a new updated object model layout diagram.

  • New files to give updated Intellisense comments.

  • Some new samples in Visual Basic.

  • Added ASF indexing support. For more information, see AsfIndexer in the Programming
    Reference.
  • A new Mode property, EncoderSku, which gives more accurate SKU information than Mode.IsExpress.

  • A new MediaItem property, FileOutputMode, which you can use to select ASF MBR as well as "Adaptive Smooth Streaming" output modes.

  • Enhancements to how output files are generated and accessed.

  • New audio overlay functionality for MediaItem.

  • Two new AAC base profiles for AudioProfiles.

  • Two new H.264 base profiles for VideoProfiles.

  • A new AdaptiveStreaming profile for both AudioProfiles and VideoProfiles.

  • A new VideoProfile profile, VideoProfileMbrDeltaCollection, which you can use to customize MBR and/or AdaptiveStreaming output streams.

  • A new default resize mode of SuperSampling instead of Bicubic.

    Here’s the link to download the updated SDK.

    http://www.microsoft.com/downloads/details.aspx?FamilyId=9A077A3D-58CE-454C-B486-153F0578BE4A&displaylang=en

  • Expression Encoder

    Silverlight and Expression Encoder to support H.264

    • 3 Comments

    In case you missed this press release, we just announced that H.264 support is coming to both Silverlight and Expression Encoder.

    Later this week, at the International Broadcasting Conference (IBC) 2008 in Amsterdam, Microsoft Corp. will demonstrate an important new capability for Silverlight - playback of H.264-based video. H264 is a standard video specification that delivers high-definition video over a variety of delivery channels. During the event, Microsoft will also highlight how customers in Europe are reaping the benefits of adopting Silverlight.

    At IBC 2008 we will be demonstrating a technology preview of H.264 video and Advanced Audio Coding (AAC) audio playback support in Silverlight, and H.264 authoring using Microsoft Expression Encoder and Windows Server 2008 for delivery. Until now, Silverlight has supported the SMPTE VC-1 and Windows Media formats, as well as MP3 for audio, enabling customers to take advantage of broad support across the Windows Media ecosystem, including third-party tools, service providers and content delivery networks.

    We’ll be talking more about the next release of Expression Encoder at Streaming Media West 2008 in a couple of weeks time.

  • Expression Encoder

    Expression Encoder Wins Most Innovative Product at Business Video Expo

    • 0 Comments

     Enterprise video is increasingly being recognized by industry experts, such as Gartner, as an important strategic technology.  Accordingly, the Expression Encoder and IIS Media Services Team attended the new Business Video Expo, part of ITEXPO East 2011.  The event included about 180 exhibitors and attracted nearly 8,000 attendees, 80% of whom were executives.

     

    Microsoft exhibited with Accordent Technologies, a partner that has developed an automated software-based video creation, management, publishing, and delivery platform leveraging Microsoft infrastructure in the enterprise, including SharePoint, Lync, Windows Server, IIS, Windows Media Services, Silverlight, and Expression Encoder.

    The team participated in conference panel discussions on topics ranging from mobile delivery to YouTube in the enterprise (videos of those panels coming soon), and IIS Media Services senior product manager Chris Knowlton was recorded doing both an in-booth Expression Encoder / IIS / iPad demo and an on-site interview with Steve Vonder Haar

    Additionally, both Microsoft and Accordent were recipients of Best in Show awards - Expression Encoder was awarded Most Innovative Product and Accordent received Best Enterprise Solution.  Congrats to the team! 

    Microsoft and Accordent recently participated in a webinar to talk about how the companies are addressing the challenges of deploying video in the enterprise.  To view the archived content, please login here.   

  • Expression Encoder

    Thank you

    • 1 Comments

    Thanks to everyone that voted for us in the Streaming Media Readers' Choice Awards!  We are a finalist in the Encoders under $1000 category.

    http://bit.ly/bhTepe

  • Expression Encoder

    Tidbits about Indexing

    • 2 Comments

    When importing certain media files like VOB, TS and M2TS files, Expression Encoder needs to parse through the file to ensure the duration and video frame timestamps are accurate by creating its own corrected table of content in memory. Without this analysis, the encoded output files could have the wrong duration (either trimmed or having extra black frames at the end) and audio video sync could not be guaranteed, especially if the file was trimmed.

    This analysis operation, called indexing, is unfortunately time consuming since it requires to read and demux the whole media file and typically requires a few minutes per hour of content, mostly depending on storage speed. Because of this, it is recommended to first copy this type of media file locally before importing it to ensure maximum efficiency.

    Note that while this operation is automatically executed upon import within the Encoder application, it is not executed by default when importing a media file via the SDK and needs to be explicitly called before the MediaItem constructor via the CalculateDuration member of AudioVideoFile like this:

                         AudioVideoFile file = new AudioVideoFile(filename);

                         file.CalculateDuration(null);

                         MediaItem item = new MediaItem(file);

    It is worth pointing that if the CalculateDuration method isn't called, there will still be indexing done in-line during the encoding which will fix the timestamps, but it is possible that the duration of the output file will be wrong. For this reason, we highly recommend using the code above if source files that require indexing are used.

     

  • Expression Encoder

    Tutorial on encoding screen recordings for Silverlight using Expression Encoder 2

    • 3 Comments

    Ben Waggoner just did a great blog post that shows you how to encode screen recordings for display in Silverlight.  We on the Expression Encoder team like his settings so much that we are using them as the defaults in the final version of Expression Encoder 2.

    You can see the results over on the IIS blog.  Here is an example:

    Installing Necessary IIS Components on Windows Vista

    Install only the components you need for your Web applications by leveraging IIS7’s modular architecture.  This tutorial will cover installing the modules necessary for serving ASP and ASP.NET pages from IIS7 in Windows Vista.

    image

    As Ben says, make sure you go full screen to get the full effect.

  • Expression Encoder

    Help and Intellisense for the Expression Encoder Object Model.

    • 3 Comments

    We're busy working on a more official SDK and some samples that use the Expression Encoder object model, but in the meantime here's a link to a zip file that contains a couple of XML files that will enable Intellisense comments and a CHM help file.

    ExpressionEncoderOM.zip

     (UPDATE: I've also added the file as an attachment to this post in case the server that contains the first link isn't up).

    Once you've installed Expression Encoder 2 and downloaded and extracted the zip file, copy the two XML files to your "\Program Files\Microsoft Expression\Encoder 2\SDK" directory. The next time you create or load a project that uses the object model you should get descriptions for the methods and properties like below.

    Intellisense

    The CHM file is a help file that was actually built from the source code using Sandcastle. If you open the file and it just says "Navigation to the webpage was canceled" in the right pane you need to "Unblock" the file first. Right click the CHM file, select Properties and on the General tab click the Unblock button near the bottom right. Now reopen the file and everything should be fine.

    Help

    Hope you find these useful and let us know if you have any questions.

  • Expression Encoder

    Microsoft Expression News

    • 0 Comments

    We released important news today about the Expression family of products.  Please visit the Expression Community site for details.

  • Expression Encoder

    Expression Encoder Customer Panel

    • 7 Comments

    Now that Expression Encoder 2 has been released, the team is hard at work on the next version of the product.
    We want to be as responsive to community feedback as possible, and would like to set up a panel of customers with whom we can have ongoing conversations.

    What is the Customer Panel?

    The Customer Panel is a way for us to build strong relationships with users of our product. We'll use it as a way to understand your needs, workflows as well as how you use the product. We'll also use it to float future feature ideas and get feedback on them

    What is the time requirement?

    The Customer Panel is an ongoing project. The overall impact should be minimal and if at any point you no longer want to participate, just tell us. Typically we'll aim to reach out the Panel every couple of months or so. There may some times when we reach out more frequently.

    How is this different to a Technology Adoption Program (TAP)?

    TAPs are for specific releases and focus on getting you pre-releases of the software to play with. We'll use the same framework for the Customer Panel, but it is longer lived and goes beyond a particular release. This is an opportunity to have lasting impact on product direction.

    OK sign me up!

    If you want to take part, please send me an email by clicking here.

  • Expression Encoder

    T09 at MIX is done

    • 10 Comments

    Charles and I presented our Session at MIX08 on Expression Encoder 2 this morning.  It went reasonably well.  With luck the video should appear here shortly.  We'll re-publish it on the blog sometime next week.

    We also have a couple of other MIX videos to publish soon.  In the meantime, here are some pix that David shot:

    IMG_1130 IMG_1134 IMG_1147

  • Expression Encoder

    Expression Encoder 2 MIX sessions

    • 2 Comments

    Here are some of the sessions at MIX08 that highlighted or included Expression Encoder:

    http://sessions.visitmix.com/?selectedSearch=T09 Overview of Expression Encoder 2
    http://sessions.visitmix.com/?selectedSearch=BCT07 Encoding Video For Microsoft Silverlight Delivery Scenarios
    http://sessions.visitmix.com/?selectedSearch=BCT05 Integrating Media Into Silverlight Applications (around 0:41:00)
    http://sessions.visitmix.com/?selectedSearch=BT06 Silverlight and Advertising (around 0:40:50)
    http://sessions.visitmix.com/?selectedSearch=KYN0801 Day one KeyNote  (around 1:09:50)

  • Expression Encoder

    Hello from Mix 08

    • 6 Comments

    Charles and I have arrived here at The Venetian ready for Mix08.

    Our session is currently blacklisted but should appear here shortly:

    http://sessions.visitmix.com/

    If you are attending and want to meet up with us, do send email.

    Need to test that image uploading is working so here is a view from my window:

    IMAGE_332
  • Page 2 of 2 (46 items) 12