Creating a encoding job with rest using external url

Varun Srivastava 1 Reputation point
2022-10-18T12:51:21.443+00:00

Currently, I am using Azure media service(v3) rest API to create a job to encode my video. the parameter which I am passing in the rest API body is given below:-

let params = {
"properties": {
"input": {
"@odata.type": "#Microsoft.Media.JobInputAsset",
"assetName": "demoinputassestsname"
},
"outputs": [
{
"@odata.type": "#Microsoft.Media.JobOutputAsset",
"assetName": "demooutputassestsname"
}
]
}
};

so my issue is that now I want to create a job using an external URL, not with input assets. so is this possible with the rest API cuz In the whole ams (v3) documentation I did not find what parameter should I need to pass in the rest API body where the external URL should use.

by external URL I mean when you went to create a job manually into the azure platform itself than during creating the job you have two options to choose from, one is input assets and another one is external URL. so I have to programmatically create the job using external URL.. which by the way already been given in the documentation by using input assets, not with external url.

Thanks

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
315 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Deutscher (MSFT) 2,126 Reputation points
    2022-10-18T17:40:35.11+00:00

    First concern - why are you using the raw REST API instead of one of the many supported client SDKs in various languages? I would encourage you to use the supported SDKs' instead of rolling your own client SDK code - it can cause a lot of issues with Retry policies and ARM resource management for long running operations. That's all built into the SDKs.

    Can you work with Node.js or Typescript? https://github.com/Azure-Samples/media-services-v3-node-tutorials/blob/main/VideoEncoding/Encoding_H264_ContentAware_Constrained/index.ts

    To answer your question - you are looking to use the JobIntputHttp object in the REST api (same name in the SDKs) - see here for the full Open API schema definition of that entity:
    https://github.com/Azure/azure-rest-api-specs/blob/db38bff6ab588858ee1df6f86ae1d0ec4d2d5781/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-06-01/Encoding.json#L1932

        "JobInputHttp": {  
          "x-ms-discriminator-value": "#Microsoft.Media.JobInputHttp",  
          "allOf": [  
            {  
              "$ref": "#/definitions/JobInputClip"  
            }  
          ],  
          "properties": {  
            "baseUri": {  
              "type": "string",  
              "description": "Base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. Maximum length of 4000 characters. The query strings will not be returned in service responses to prevent sensitive data exposure."  
            }  
          },  
          "type": "object",  
          "description": "Represents HTTPS job input."  
        },  
    
    0 comments No comments