php - How to get a Thumbnail from a Video on Azure Media Services? -


i start new azure , azure php sdk because i'm php developer. azure php sdk, can store video , video url. want know how create video thumbnails azure. don't know how do.

to create thumbnail should create job usual setting thumbnail xml via setconfiguration.

this untested code should work.

// sets thumbnail configuration $thumbnailconfig = <<<eot  <?xml version="1.0" encoding="utf-8"?>  <thumbnail size="50%,*" type="jpeg" filename="{originalfilename}_{size}_{thumbnailtime}_{thumbnailindex}_{date}_{time}.{defaultextension}">  <time value="10%"/> </thumbnail> eot;  $xmltask = '<taskbody><inputasset>jobinputasset(0)</inputasset>'           . '<outputasset>joboutputasset(0)</outputasset></taskbody>';  $mediaprocessor = $restproxy->getlatestmediaprocessor('azure media encoder');  $task = new task($xmltask, $mediaprocessor->getid(), taskoptions::none); $task->setconfiguration($thumbnailconfig);  $restproxy->createjob(new job(), array($inputasset), array($task)); 

you should connect media services first, more information go here

connection snippet:

$restproxy = servicesbuilder->getinstance()->createmediaservicesservice(           new mediaservicessettings([youraccountname],                            [yourprimaryorsecondaryaccesskey])); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -