Search code examples
azureazure-media-services

Azure Encoding Job returns no OuputAssetFiles


Using the REST API documentation I am encoding a video using the following request to azure:

{
    "Name": "NewTestJob",
    "InputMediaAssets": [{
            "__metadata": {
                "uri": "https://media.windows.net/api/Assets('nb%3Acid%3AUUID%3Ab5cb32de-AAAA-BBBB-a6eb-1b3a61c795be')"
            }
        }
    ],
    "Tasks": [{
            "Configuration": "H264 Single Bitrate 720p",
            "MediaProcessorId": "nb:mpid:UUID:ff4df607-d419-42f0-bc17-a481b1331e56",
            "TaskBody": "<?xml version=\"1.0\" encoding=\"utf-8\"?><taskBody><inputAsset>JobInputAsset(0)</inputAsset><outputAsset>JobOutputAsset(0)</outputAsset></taskBody>"
        }
    ]
}

From what I can see in the Azure dashboard this creates an encoded version of my video, the problem I have is that the returned job information does not have any OutputMediaAssets. The response is:

{
    "odata.metadata": "https://wamsamsclus001rest-hs.cloudapp.net/api/$metadata#Jobs/@Element",
    "Id": "nb:jid:UUID:e4bf4cff-0300-80c0-c4c5-f1e75c34a72c",
    "Name": "NewTestJob",
    "Created": "2017-06-28T19:04:55.8442399Z",
    "LastModified": "2017-06-28T19:04:55.8442399Z",
    "EndTime": null,
    "Priority": 0,
    "RunningDuration": 0.0,
    "StartTime": null,
    "State": 0,
    "TemplateId": null,
    "JobNotificationSubscriptions": []
}

This means I can't locate the newly created encoded asset. What am I doing wrong? Is there another way to locate the generated asset?


Solution

  • The problem wasn't caused by the Request Body but instead the header.

    I was passing the header:

    Accept: application/json
    

    Instead of the header:

    Accept: application/json;odata=verbose
    

    The lack of the odata=verbose means that only a subset of the available data is returned.