doupaoshu8334 2013-03-18 16:54
浏览 59

如何创建PHP函数以向AWS创建此JSON请求(创建作业)

There is a new service on AWS called Elastic Transcoder. I know some PHP, but I have bitten off more than I can chew on this one...

How would I create a simple PHP function that will take my variables and create a JSON request (properly formatted of course) and create a job on the AWS. Here is the syntax that AWS supplies:

NOTE: I have a form already created that will be able to supply all the required fields.

To create a job, send a POST request to the

/2012-09-25/jobs

resource.

This is the syntax:

POST /2012-09-25/jobs HTTP/1.1
Content-Type: application/json; charset=UTF-8
Accept: */*
Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443
x-amz-date: Mon, 14 Jan 2013 17:49:52 GMT
Authorization: AWS4-HMAC-SHA256 
           Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/ets/aws4_request,
           SignedHeaders=host;x-amz-date;x-amz-target,
           Signature=calculated-signature
Content-Length: number of characters in the JSON string
{
"Input":{
  "Key":"name of the file to transcode",
  "FrameRate":"auto"|"10"|"15"|"23.97"|"24"|"25"|"29.97"|"30"|"60",
  "Resolution":"auto"|"width in pixelsxheight in pixels",
  "AspectRatio":"auto"|"1:1"|"4:3"|"3:2"|"16:9",
  "Interlaced":"auto"|"true"|"false",
  "Container":"auto"|"3gp"|"asf"|"avi"|"divx"|"flv"|"mkv"|"mov"|"mp4"|
     "mpeg"|"mpeg-ps"|"mpeg-ts"|"mxf"|"ogg"|"vob"|"wav"|"webm"
},
"Output":{
  "Key":"name of the transcoded file",
  "ThumbnailPattern":""|"pattern",
  "Rotate":"auto"|"0"|"90"|"180"|"270",
  "PresetId":"preset to use for the job"
},
"PipelineId":"pipeline to add the job to"
}

The parts of the above code that need to be supplied are show in italics in this original posting of the syntax:

http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html#create-job-examples

  • 写回答

2条回答 默认 最新

  • douhanzhuo6905 2013-03-18 23:56
    关注

    The AWS SDK for PHP includes support for Amazon Elastic Transcoder. Is there a reason that you don't want to use that? Here is a link to the PHP SDK documentation.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab实现基于主成分变换的图像融合。
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊