Azure及AWS媒体服务API调研.docx

上传人:牧羊曲112 文档编号:2011067 上传时间:2022-12-31 格式:DOCX 页数:32 大小:450.59KB
返回 下载 相关 举报
Azure及AWS媒体服务API调研.docx_第1页
第1页 / 共32页
Azure及AWS媒体服务API调研.docx_第2页
第2页 / 共32页
Azure及AWS媒体服务API调研.docx_第3页
第3页 / 共32页
Azure及AWS媒体服务API调研.docx_第4页
第4页 / 共32页
Azure及AWS媒体服务API调研.docx_第5页
第5页 / 共32页
点击查看更多>>
资源描述

《Azure及AWS媒体服务API调研.docx》由会员分享,可在线阅读,更多相关《Azure及AWS媒体服务API调研.docx(32页珍藏版)》请在三一办公上搜索。

1、Azure及AWS媒体服务API调研高天龙 windows Azure1什么是windows Azure1windows Azure提供的功能1媒体功能2微软Azure云计算流式视频服务平台2媒体服务的应用场景3应用实例4Windows Azures Media Services REST API5Setup for Media Services REST API Development5Identify Windows Azure Media Services Entities7Connect To Media Services Using the Media Services REST A

2、PI8Ingest Assets with the media Services REST API;10Ingesting Assets in Bulk with the REST API16Process Asset with the Media Services REST API19Manage Assets with the Media Services REST API22Deliver Assets with the Media Services REST API24AWS Digital Media API27什么是AWS27AWS提供的功能:27Digital Media on

3、AWS28应用实例31windows Azure什么是windows Azurewindows Azure是为了管理微软建设的数据中心的服务器,网络和存储资源而开发的一款windows server 操作系统。windows Azure提供的功能网站,虚拟机,云服务,大型数据,媒体,移动服务。媒体功能支持插入(Ingest)、编码(Encode)、保护(Protect)、流式(Stream)处理,在云中创建、管理和分发媒体。Windows Azure 的媒体服务 PaaS 产品/服务提供了从编码到内容保护再到流和分析的所有内容。涵盖具有 HTML5、Flash 和 Silverlight 的

4、Windows 8、Windows phone、Xbox、iOS 和 Android 设备。微软Azure云计算流式视频服务平台企业不必通过编码或流媒体构建架构来分配视频内容。微软凭借Windows Azure Media Services扩展了云计算服务,Windows Azure Media Services可以省去企业构建流媒体点播视频的麻烦。 微软的Scott Guthrie称,这项服务可以为企业员工提供培训视频,网站的流视频内容,构建Hulu(Netflix)一样的视频点播服务。和许多基于云计算的平台 即服务(PaaS)一样,Windows Azure Media Services旨

5、在于使过程简单化,于是,推出了视频流服务。微软Windows Azure官方宣传Guthrie表示,构建一个媒体的分布式平台,为不同设备和客户端设置不同代码和视频流是非常复杂的任务,需要软、硬件的连接,配置和维护。微软的Azure Media Services不再需要提供和管理自定义的基础设施,可以让这个过程变得非常简单。 企业可以利用Azure Media Services将视频传到基于Windows、iOS、Android系统的掌上电脑、平板电脑、智能手机和游戏机等设备上。开发者可以利用从 Azure开发者网站上下载的REST、APIs、.net、或SDKs构建自动上传、编码、发送视频的工

6、作流。在网站上,开发者可以浏览帮助文档。Guthrie表示,个人预览版本支持实时流媒体,公共预览版以后将陆续推出。对于收费方式,Azure Media Services是统一收费,每GB 1.99美元,需更大容量就要额外付费。媒体服务的应用场景building end-to-end workflows 构建端到端的工作流在云中构建全面的媒体工作流。从上传媒体到分发内容,媒体服务提供了一系列预生成,使用就绪,第一方和第三方组件,可以组合这些组件以满足您的特定需求。功能包括上传,存储,编码,格式转换,内容保护和交付。building-hybrid workflows开发混合工作流将媒体服务与您已使

7、用的工具和流程集成。例如:现场编码内容,然后将其上传到媒体服务以便转码为多种格式并通过第三方CDN交付。可通过标准REST API 单独调用媒体服务以便于外部应用程序和服务轻松集成。providing cloud support for media player提供针对多台设备和平台的云支持跨多种设备创建,管理和交付媒体从未如此简单。媒体服务为您提供向各种设备(Xbox, Windows PC, MacOS,iOS 和Android)交付内容所需的一切。应用实例2012年7月19日,PPTV网络电视和微软在上海签署谅解备忘录,利用Windows Azure平台开发PPTV ATN(Asia T

8、V Networks)电视云平台。PPTV ATN平台能将世界各地的内容商将自己的内容上传到ATN平台上,并授权给各国/地区的服务运营商使用,同时服务运营商不需要昂贵的初期投入资本,就可以迅速整合各类视频资源,快速实现内容定制,定价及广告运作和收费电视的推送。Windows Azures Media Services REST API名词解释:Media Services中的实体:EntityDesciption中文AssetsAn asset is a virutal entity that holds metadata about media.文件夹FilesA file is an ac

9、tual video or audio blob object on the file system or on a remote server.文件JobsA job is an entity that holds metadata about tasks作业,可能含有多个任务TasksA task is an individual operation of work on an asset or file. A task is associated with a job.任务AccessPoliciesAn access policy defines the permissions to

10、a file or an asset(what type of access, and the duration).定义了对文件或asset的访问类型和时间限制LocatorsA locator is a URI that provides time-based access to a specific asset.是一个URI,能在一定时间范围内访问某个asset.Job TemplatesA job template provides reusable settings for jobs that you want to run repeatedly. A job template is

11、composed of a collection of task templates.作业模版ContentKeysA content key stores key data that used to encrypt an asset保存加密信息TaskTemplatesA task template provides reusable settings for tasks that you want to run repeatedly.Each job template has a collection of task templates.任务模版Setup for Media Servic

12、es REST API DevelopmentMedia Services支持的HTTP方法:VerbDescription中文翻译GETreturn the current value of object获取有URI标识的任何信息POSTCreate an object based on the data provided, or submits a command创建一个对象或者执行一条命令PUTreplaces an object, or creates a named object(when applicable).创建一个命名对象或者替换一个存在对象。DELETEDeletes an

13、 object删除一个对象MERGEUpdates an existing object with named property changes.更新已经存在对象的属性HEADReturn metadata of an object for a GET response除了服务器不返回实体,HEAD和GET方法是一致的媒体服务支持的HTTP请求头部(必选):HeaderTypeValueAuthorizationBeaerx-ms-versionDecimal2.0DataServiceVersionDecimal3.0MaxDataServiceVersionDecimal3.0媒体服务支持

14、的请求头部(可选):HeaderTypeValueDateRFC 1123 dateTimestamp of the requestAcceptContent typeapplication/json;odata=verboseAccept-EncodingGzip,deflate对资源,服务可能不压缩而直接返回Accept-Language“en”人类可读的语言Accept-CharsetCharset type like UTF-8字符集,默认UTF-8X-HTTP-MethodHTTP Method通过隧道方式,允许通过GET方法实现防火墙等不支持的PUT/DELETE方法 Conten

15、t-TypeContent type PUT/POST 中实体的类型client-request-idString呼叫方定义的标记本次请求,如有必要,返回时也可以带此信息媒体服务支持的响应头部(可选):HeaderTypeValuerequest-idString服务端产生的的代表本次操作的标识client-request-idString请求方带来的标识DateRFC 1123 date请求处理时的时间Content-TypeVaries响应实体的类型Content-EncodingVariesGzip or deflate Identify Windows Azure Media Serv

16、ices EntitiesMedia Services的命名机制nb:type:scheme:SSID例子:nb:cid:UUID:0234c75e-7b62-4d81-9373-d869478a6643type: is the type of content idenetifier。内容标识符的类型scheme: is a Media Services recognized naming scheme. 命名方案SSID:scheme-specific ID , is a string that corresponds with IDs in scheme, default UUID, RF

17、C 4122.type:EntityContent Identifier TypeAssetcidAccessPolicypidLocatorlidAssetFilecidContentKeykidJobTemplatejtidTaskTemplatettidJobjidTasktidMediaProcessormpidIngestManifestmidIngestManifestAssetmaidIngestManifestFilemfidConnect To Media Services Using the Media Services REST API连接到媒体服务的REST APIWi

18、ndows Azure Access Control Service: ACS , create the access token.连接Media Services 需要两样东西:An access token and the URI of Media Services .step1. Getting an access token获得访问令牌获得令牌的HTTP请求POST HTTP/1.1Content-Type: application/x-www-form-urlencodedHost: Content-Length: 120Expect: 100-continueConnection:

19、 Keep-Alivegrant_type=client_credentials&client_id=client id value&client_secret=URL-encoded client secret value&scope=urn%3aWindowsAzureMediaServicesclient_id: AccountName,帐户名。client_secret:AccountKey,密码。获取AccessToken的HTTP 响应:HTTP/1.1 200 OKCache-Control: public, no-store, max-age=0Content-Type: ap

20、plication/json; charset=utf-8Expires: Fri, 13 Jan 2012 22:40:07 GMTLast-Modified: Fri, 13 Jan 2012 22:40:07 GMTVary: *Server: Microsoft-IIS/7.5Set-Cookie: ASP.NET_SessionId=w3mtu2rnxucaz5tvj0iyfm0t; path=/; HttpOnlyX-AspNetMvc-Version: 2.0X-AspNet-Version: 4.0.30319X-Powered-By: ASP.NETX-Content-Typ

21、e-Options: nosniffDate: Fri, 13 Jan 2012 22:40:07 GMTContent-Length: 580access_token:http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=client_id&http%3a%2f%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2f&Audience=urn%3aWindowsAzureMe

22、diaServices&ExpiresOn=1326498007&Issuer=https%3a%2f%2f %2f&HMACSHA256=hV1WF7sTe%2ffoHqzK%2ftmnwQY22NRPaDytcOOpC9Nv4DA%3d,token_type:http:/schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0,expires_in:3599,scope:urn:WindowsAzureMediaServicesConnecting to the Media Services URI访问媒体服务的URI:Media Servi

23、ces 的根URI是 上传,下载 Asset 的根URI是 创建一个Asset:POST HTTP/1.1Content-Type: application/json;odata=verboseAccept: application/json;odata=verboseDataServiceVersion: 3.0MaxDataServiceVersion: 3.0x-ms-version: 2.0Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnamei

24、dentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1335602357&Issuer=https%3a%2f%2f&HMACSHA256=XQs5T%2fEfdO39%2f0Z9%2fBBkA12%2b

25、bUUEY21YyefWXuRYZlY%3dHost: Content-Length: 27Expect: 100-continue Name : NewJSONAsset Ingest Assets with the media Services REST API;用REST 风格 API 插入 Assets:插入Asset的步骤:1. Create an Asset 2. Encrypt an Asset3. Upload a file to blob storage1.Create the Asset: 创建Asset什么是Asset?an asset is a container fo

26、r multiple types or sets of objects in Media Services, including video, audio, images, thumbnail collections, text tracks, and closed caption files.POST HTTP/1.1Content-Type: application/json;odata=verboseAccept: application/json;odata=verboseDataServiceVersion: 3.0MaxDataServiceVersion: 3.0x-ms-ver

27、sion: 1.0Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2f&Audience=urn%3aWind

28、owsAzureMediaServices&ExpiresOn=1335602357&Issuer=https%3a%2f%2f&HMACSHA256=XQs5T%2fEfdO39%2f0Z9%2fBBkA12%2bbUUEY21YyefWXuRYZlY%3dHost: Content-Length: 27Expect: 100-continue Name : NewJSONAsset Create the assets Response:HTTP/1.1 201 CreatedCache-Control: no-cacheContent-Length: 1353Content-Type: a

29、pplication/json;odata=verbose;charset=utf-8Location: Server: Microsoft-IIS/7.5x-ms-request-id: 7739638a-da3a-4a6e-ad51-ea0bf87f02adX-Content-Type-Options: nosniffDataServiceVersion: 1.0;X-AspNet-Version: 4.0.30319X-Powered-By: ASP.NETDate: Fri, 27 Apr 2012 22:39:18 GMTd:_metadata:id:2. Encrypt an As

30、set(Optional)3. Upload a file to blob storage上传文件到存储 传文件到blob 存储,blob(binary large object)a. Set the AccessPolicy:设置asset的写权限,DurationInMinutesb. retrieve a URL to upload the file to c. perform the actual upload actions;step1. Set the AccessPolicyPOST HTTP/1.1Content-Type: application/json;odata=ver

31、boseAccept: application/json;odata=verboseDataServiceVersion: 3.0MaxDataServiceVersion: 3.0x-ms-version: 1.0Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2

32、f%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1335956356&Issuer=https%3a%2f%2f&HMACSHA256=1B1ysfYRcpI%2fQY9SSNIBBVBpgc67j4R2yXD7BCxs8D8%3dHost: Content-Length: 76Expect: 100-continueName: NewUploadPolicy, DurationIn

33、Minutes : 300, Permissions : 2 Set the accessPolicy Response:HTTP/1.1 201 CreatedCache-Control: no-cacheContent-Length: 526Content-Type: application/json;odata=verbose;charset=utf-8Location: Server: Microsoft-IIS/7.5x-ms-request-id: 0a262141-e539-4fa6-b5d6-80cdf26d3ff6X-Content-Type-Options: nosniff

34、DataServiceVersion: 1.0;X-AspNet-Version: 4.0.30319X-Powered-By: ASP.NETDate: Wed, 02 May 2012 00:59:30 GMTd:_metadata:id:step2. Get The Upload URL 获得上传的URL为了获取真实上传URL,必须创建一个定位器。Create a Locator entity: POST HTTP/1.1Content-Type: application/json;odata=verboseAccept: application/json;odata=verboseDa

35、taServiceVersion: 3.0MaxDataServiceVersion: 3.0x-ms-version: 1.0Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2faccesscontrolservice%2f2010%2f07%2fclaim

36、s%2fidentityprovider=https%3a%2f%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1335956356&Issuer=https%3a%2f%2f&HMACSHA256=1B1ysfYRcpI%2fQY9SSNIBBVBpgc67j4R2yXD7BCxs8D8%3dHost: Content-Length: 183Expect: 100-continueAccessPolicyId: nb:pid:UUID:94763883-537a-41c0-a097-4e3f755bbeab, AssetId :

37、nb:cid:UUID:cab358e0-deaa-4c4f-9a9f-35687b54b0aa, StartTime : 5/2/2012 1:04:32 AM, Type : 1 Create Locator Response:HTTP/1.1 201 CreatedCache-Control: no-cacheContent-Length: 1148Content-Type: application/json;odata=verbose;charset=utf-8Location: Server: Microsoft-IIS/7.5x-ms-request-id: 6937fd51-70ad-4d3d-813

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号