• Rough Cut Editor (RCE) and IIS Transform Manager: Best Friends

    Published by on July 27th, 2010 10:15 am under Adaptive Streaming, Emerging Technology, IIS Transform Manager, IIS7, Media, RCE, Rough Cut Editing, Smooth Streaming

    15 Comments

    A month ago, Microsoft published the alpha version of the IIS Transform Manager. The Transform Manager provides simple integrated video encoding and batch conversion of video files to the IIS Smooth Streaming format.  It does this quite nicely, as it provides an extensible platform for scheduling and running multiple tasks in sequence on an IIS server using a local task scheduler. It enables “watch folder” job submission, queuing, management, integrated media transcoding/transmuxing, and batch-encryption of on-demand audio and video files. You can get more information from here, here and here.

     

    My friend John Deutscher is leading these efforts. John has a lot of experience with media management software and a passion to make developers lives’ easier. He was also one of the masterminds behind the Rough Cut Editor (RCE), a lightweight, Web-based Silverlight video editing tool. As a client tool, it submits edit decision lists, but does not include the logic for transcoding. But it’s highly extensible, and from time-to-time, we’ve been asked about extending the tool to add an encoding workflow process.

     

    The real question here is whether the RCE should take care of that. Instead, Why not take advantage of the tools available out there and use them to manage the complexity of the encoding process?

     

    This post is result of exploring the feasibility of using the IIS Transform Manager to take an RCE Project XML file (which includes the EDL) as input, and creating the necessary task to output a new encoded video that represents the RCE edits?

    So with that goal in mind, I started to build a proof of concept of the scenario, depicted in the following diagram:

    image

    PoC Diagram – (icons from picol.org)

    The Ingredients

    The Recipe

    OK. Let’s assume we have all the ingredients in place and that we are ready to start.

    The first thing to do is to create the Transform Manager Task. This task will parse the RCE Project XML, extract the edits metadata and use that information with the Expression Encoder 4 API to perform the encoding.

    I will not copy all the code for the Task in the post (you can download that from here. Make sure to include into the libs folder the EE4 and IIS Transform Manager assemblies in order to build the project), but instead let me highlight a few things:

    1. To create a custom Task for the IIS Transform Manager you must implement the ITransformTask interface (Microsoft.Web.Media.TransformManager.Sdk.dll)
    2. Once you have created the task, you must create a task definition xml file (the task definition schema can be found here).
      The following is the Task Definition for the RCE Project task:

      <taskDefinition xmlns=http://schemas.microsoft.com/iis/media/v4/TM/TaskDefinition#> <name>RCE Project Task</name> <id>7F8A89DA-1DF9-409A-9869-A5CDCA017998</id> <properties namespace=http://schemas.microsoft.com/RCE/V1#prefix=rce> <property name=presetvalue=“” /> </properties> <description xml:lang=en>Invokes Expression Encoder 4 to produce a video based on the edits metadata defined on an RCE Project File</description> <inputDirectory></inputDirectory> <outputDirectory>RCEProjectTaskOutput</outputDirectory> <taskCode> <type architecture=x86>RCE.TransformManager.Tasks.RCEProjectTask, RCE.TransformManager.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</type> </taskCode> </taskDefinition>  

      As you can see, it defines a property called preset, which is intended to be used to provide the Expression Encoder 4 preset.

      – The input directory points to the directory where the source videos are located (which is the same directory used on the RCE File System Data Provider configuration)

      – The output directory will be later used by an XCopy task defined on the Job Template that will copy the resulting files back to the source videos directory (making the resulting video available to the RCE)

    3. Register the task with the IIS Transform Manager. A great tutorial on how to do custom task registration can be found here, but it basically involves two steps:- Copy the custom task assembly to C:\Program Files\IIS\Transform Manager (on a x86 computer) or to to C:\Program Files (x86)\IIS\Transform Manager (on a x64 computer)

      – Copy the custom task definition XML file to the %ProgramData%\Microsoft\IIS\Transform Manager\Configuration\Task Definitions directory

     

    Once you have your Transform Manager task ready and configured, launch the Internet Information Services and configure the IIS Transform Manager.

    First, stop and start the IIS Transform Manager service so it can detect the new task, then follow these steps to create a job template.

    1. Create a New Job Template (Transform Manager > Job Templates > New) and fill the Name field.image
    2. Click Add to launch the Add Task dialog.image
    3. Select the RCE Project Task and the XCopy Task and click OK.
    4. Make sure that the task definitions list shows the RCE Project task on top of the XCopy task (use the Move Up / Move Down buttons to adjust it)image
    5. Select the RCE Project Task and click Edit.
    6. Fill the input directory field and the preset property. Click OK to save.imageNote: I’m using one of the predefined presets of EE4 (VC1-ScreenEncoding VBR for Silverlight), but you can use any you prefer.
    7. Select the XCopy task and click Edit.
    8. Fill the fields as described below. Click OK to save.
      • Input Directory: RCEProjectTaskOutput
      • Arguments: RCEProjectTaskOutput\* “d:\media\demo\videos” /E /Y /INote: (replace d:\media\demo\videos with the input directory you defined on the RCE Project Task)image 
    9. Click OK to save the job template.

     

    Now it is time to add the Watch Folder. For the sake of simplicity, in the PoC, I will use the folder where the RCE exports the project output. This folder is located at

    RCE.Web\encode\Queue.

    Note: For this PoC, I’m running all the components (RCE, IIS Transform Manager, Expression Encoder 4) in the same computer, which is unlikely for a production environment, but makes it easy to develop on a single machine.
    1. Create a new watch folder (Transform Manager > Watch Folders > New)
    2. Fill the watch folder settings:
      • Name. The name of the folder
      • Physical Path. The watch folder path (%RCEDirectory%/RCE.Web\encode\Queue)
      • File Filter. Use *.jobreq here, which is the extension the RCE Export operation output.
      • Job Template. Select the RCE Job Template image
    3. Click OK to save the watch folder.
    4. Finally, select the watch folder and click Enable and then click Start. This will leave the watch folder ready to use.

    image

    image

     

    Great!. Everything is cooked. Let’s see how it tastes.

    1. Launch the RCE and perform a couple of edits. I’ve four videos on my library and I created an edit of around 1 minutes and 56 seconds using two of those videos.image
    2. Select the Output Tab, and click Export to export the RCE project.image
    3. Open the IIS and go to the Job Monitor option of the IIS Transform Manager. You will see that your job is running!!image
    4. Once the encoding is completed, the second task of the job is going to be executed, copying the new file on the folder you configured.
    5. Refresh the RCE (press F5), and you’ll see a new video on the library, with the exact same duration of the edit you created.

    image

     

    The End :)

    We just proved that the RCE and the IIS Transform Manager can easily work together. The IIS Transform Manager’s extensibility allowed us to create a simple task to integrate the RCE export process with it and to output a new encoded video that represents the RCE edits. And this is just the beginning…

     

    Hope this helps,

    Happy Transforming!

     

    THE CODE AND THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS.

    Tags: , , , , ,

    • http://www.radio.nl Valentijn

      Almost there implementing the task/project. One issue left, the Transform manager breaks with this description in the log:

      Error in line 1 position 149. Element ‘http://schemas.microsoft.com/rce/:Metadata’ contains data from a type that maps to the name ‘http://schemas.microsoft.com/rce/:ExpressionEncoderMetadata’. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to ‘ExpressionEncoderMetadata’ to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.

      Should there be a known

    • http://www.terra.com.br Agnaldo Yoshida

      Hi Ezequiel,

      I had the same issue that Valentijn .
      I think I follow all of your steps, but I had this error, on Transform Manager Log …

      2012-09-24 20:36:43.8295 Error Erro na linha 1 posição 148. O elemento ‘http://schemas.microsoft.com/rce/:Item’ contém dados de um tipo que mapeia para o nome ‘http://schemas.microsoft.com/rce/:SubClipItem’. O desserializador não tem conhecimento de nenhum tipo que mapeia para esse nome. Considere usar um DataContractResolver ou adicione o tipo correspondente a ‘SubClipItem’ à lista de tipos conhecidos – por exemplo, usando o atributo KnownTypeAttribute ou adicionando-o à lista de tipos conhecidos transmitidos ao DataContractSerializer.

      Can you help me ? Any one tip about this issue ?

      Thanks at all

    • http://blogs.southworks.net/ejadib Ezequiel Jadib

      Hi Valentijn/Yoshida,

      I’m just updated the code to work with the RCE v2.0.

      Thanks,
      Ez.

    • Devendra

      Hi,

      How can I get the status of running jobs?

      Thanks
      Dev



Map

Categories