Subclip a video when encoding with Media Services - REST

You can trim or subclip a video when encoding it using a Job. This functionality works with any Transform that is built using either the BuiltInStandardEncoderPreset presets, or the StandardEncoderPreset presets.

The REST example in this topic creates a job that trims a video as it submits an encoding job.

Prerequisites

To complete the steps described in this topic, you have to:

Create a subclipping job

  1. In the Postman collection that you downloaded, select Transforms and jobs -> Create Job with Sub Clipping.

    The PUT request looks like this:

    https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaServices/:accountName/transforms/:transformName/jobs/:jobName?api-version={{api-version}}
    
  2. Update the value of "transformName" environment variable with your transform name.

  3. Select the Body tab and update the "myOutputAsset" with your output Asset name.

    {
      "properties": {
        "description": "A Job with transform cb9599fb-03b3-40eb-a2ff-7ea909f53735 and single clip.",
    
        "input": {
          "@odata.type": "#Microsoft.Media.JobInputHttp",
          "baseUri": "https://nimbuscdn-nimbuspm.streaming.mediaservices.windows.net/2b533311-b215-4409-80af-529c3e853622/",
          "files": [
          		"Ignite-short.mp4"
          	],
          "start": {
            "@odata.type": "#Microsoft.Media.AbsoluteClipTime",
            "time": "PT10S"
          },
          "end": {
            "@odata.type": "#Microsoft.Media.AbsoluteClipTime",
            "time": "PT40S"
          }
        },
    
        "outputs": [
          {
            "@odata.type": "#Microsoft.Media.JobOutputAsset",
            "assetName": "myOutputAsset"
          }
        ],
        "priority": "Normal"
      }
    }
    
  4. Press Send.

    You see the Response with the info about the job that was created and submitted and the job's status.

Next steps

How to encode with a custom transform