0
votes

I am using azure media services for mobile application.It works properly.I just Want to get the thumbnails of published assets via REST API.I need API endpoints for thumbnails.

1
Any one who can solve this issue?Muhammad Ayyaz
Here is a sample about get thumbnail with .Net.Joey Cai
Thanks for help.But i need the thumbnail with rest API in client side.Muhammad Ayyaz
Is there a reason why you can't use the sample code in an azure function and saving the asset to file/blob storage that your REST api can then pull from?Ryan Hill - MSFT
Thumbnails generated by Azure Media Services via Jobs as in the samples referenced above are stored in your Azure Storage account. You could use REST APIs from Azure Storage to access those files - assuming your client is given the privileges to make such API calls. If this does not work, please provide more details about the end-to-end scenario.Anil Murching

1 Answers

1
votes

I read sample code and try to start a job using the AMS RestAPI(V2).

Then,you can create a SASLocator to download thumbnail when the job is finished.

POST {{RESTAPIEndpoint}}/Jobs
{
  "Name": "NewThumbnailJOB",
  "InputMediaAssets": [{
    "__metadata": {
      "uri": "{{RESTAPIEndpoint}}/Assets('nb:cid:UUID:xxxxx')"
    }
  }],
  "Tasks": [{
    "Configuration":"{
      \"Version\": 1.0,
      \"Codecs\": [
        {
          \"PngLayers\": [
            {
              \"Type\": \"PngLayer\",
              \"Width\": \"100%\",
              \"Height\": \"100%\"
            }
          ],
          \"Start\": \"{Best}\",
          \"Type\": \"PngImage\"
        }
      ],
      \"Outputs\": [
        {
          \"FileName\": \"{Basename}_{Index}{Extension}\",
          \"Format\": {
            \"Type\": \"PngFormat\"
          }
        }
      ]
    }
",
    "MediaProcessorId": "{{Media Encoder Standard ID}}",
    "TaskBody": "<?xml version=\"1.0\" encoding=\"utf-8\"?>
                <taskBody>
                    <inputAsset>JobInputAsset(0)</inputAsset>
                    <outputAsset>JobOutputAsset(0)</outputAsset>
                </taskBody>"
  }]
}