What's new in version 4 SP2


This topic introduces the new features added in the Microsoft Expression Encoder 4 Service Pack 2 (SP2) release, and is intended for users already familiar with the API changes and improvements in Expression Encoder 4 and Expression Encoder 4 Service Pack 1 (SP1) releases. If you are upgrading from Microsoft Expression Encoder 3 or earlier, or if you need to become familiar with the changes in Expression Encoder 4, then you should also see What's new in version 4 and What's new in version 4 SP1 for more information.

The Expression Encoder 4 SP2 Software Development Kit (SDK) has been refined to take advantage of the following new features introduced in Expression Encoder 4 SP2:

  • Multi-channel audio support, which adds 5.1 and 7.1 audio output for both WMA and AAC.

  • SRS Audio encoding which enables you to encode 5.1 and 7.1 audio sources as stereo files. If the playback device supports SRS, then the device can reconstruct 5.1 for output.

  • Job indexing progress is now available when you load a job.

  • ScreenCaptureJob now has two new properties. One allows the capture to track the mouse and the second gives the current capture rectangle’s position.

  • Using the AudioVideoFile class, you can now get the “Best” time for creating a thumbnail. This is usually the first non-black frame in a clip. You can also specify a time range from which to get the “Best” time.

  • Sandy Bridge GPU-encoding support (Expression Encoder 4 Pro only).

Accessing the new features through the SDK

Use the below code to access the new features available in Expression Encoder 4 SP2.

MultiChannel Audio

Channels are set in AudioProfiles (an object of OutputFormat) as before, but the range has been increased. 5.1 channels are exposed as the number 6 and 7.1 channels as 8.

AacAudioProfile aac = new AacAudioProfile();
aac.Channels = 6; // 5.1 Channel output.
WmaAudioProfile wma = new WmaAudioProfile();
wma.Channels = 8; // 7.1 Channnel output.

SRS Audio Support

This option is set on the MediaItem. It is only recognized if encoding from 5.1 or 7.1 sources to stereo.

MediaItem mItem = new MediaItem(@"C:\video.wmv");
mItem.SrsAudio = true;

In Live this is set at the job level as shown below.

LiveJob job = new LiveJob();
job.SrsAudio = true;

Live Cropping

This functionality has been added to both the LiveFileSource and LiveDeviceSource objects.

            using (LiveJob liveJob = new LiveJob())
                LiveFileSource file = liveJob.AddFileSource(@"C:\video.wmv");
                // The cropped area will start at 50 pixels in from the edge side and 25 pixels from the top. 
                // It will be 75 pixels wide and 100 tall.
                file.CropRect = new System.Drawing.Rectangle(50, 25, 75, 100);

Job Indexing

A new Job.Load method has been added that allows a user to index the media items in the job as it loads, and to track the indexing progress of those items.

           job = Job.Load(@”c:\job.xej”, true, IndexStatusDelegate);

           private void IndexStatusDelegate(object obj, MultiFileIndexProgressEventArgs e)
               int index = e.Progress;

Screen Capture Mouse Tracking

Screen capture now has the ability to track the mouse pointer as you capture. This means that the capture rectangle will move with the mouse and attempt to keep it in the center of the capture area.

            using(ScreenCaptureJob job = new ScreenCaptureJob())
               job.CaptureFollowCursor = true;
               Point p = job.CaptureFollowLocation;

Calculate Best Thumbnail Time

The AudioVideoFile object has had a new method that gives the timespan for getting a non-black frame from a video. This can either be the first non-black frame or you can specify a range to look in.

            AudioVideoFile avFile = new AudioVideoFile(@”C:\video.wmv”);
            TimeSpan bestTime = avFile.CalculateBestThumbnailTime();
            bestTime = avFile.CalculateBestThumbnailTime(TimeSpan.FromSeconds(30), TimeSpan.FromMinutes(1));

Intel Graphics GPU Encoding

GPU-accelerated encoding has added support for Intel Graphics processors in addition to CUDA devices. You can use both types of devices in conjunction.

            H264EncodeDevices.EnableGpuEncoding = true;
            foreach (H264EncodeDevice device in H264EncodeDevices.Devices)
                // Enables IntelHDGraphics while disabling Cuda.
                // They can both be run concurrently.
                if (device.DeviceType == H264DeviceType.IntelHDGraphics)
                    device.Enabled = true;
                    device.Enabled = false;

   © 2011 Microsoft Corporation. All rights reserved.