【问题标题】:Elastic transcoder AWS creating job from Parse.com CloudCode Javascript http requests弹性转码器 AWS 从 Parse.com CloudCode Javascript http 请求创建作业
【发布时间】:2015-08-24 11:45:38
【问题描述】:

我在 AWS Elastic Transcoder 上创建了一个管道,并尝试使用它的 api 为它创建作业。这就是我正在做的。

Parse.Cloud.define("createJobOnElastic", function(request, response){

  Parse.Cloud.httpRequest({
 
    method: 'POST',
    headers: {
     'Content-Type': 'application/json; charset=UTF-8',
     'Accept': '*/*',
     'Host': 'elastictranscoder.us-east-1.amazonaws.com:443',
     'Content-Length': '300',
     "x-amz-date": new Date().getTime()
    },

    url: 'https://aws.elastictranscoder.us-east-1.amazonaws.com:443/2012-09-25/jobs',
    body:{
        
        "Input":{
            "Key":"fullViewLq1teqJ1Ym-nHGwcJtRuL-1433857991.895335.mp4",
            "FrameRate":"auto",
            "Resolution":"auto",
            "AspectRatio":"auto",
            "Interlaced":"auto",
            "Container":"mp4"
          },
  "OutputKeyPrefix":"compressed/",
   "Outputs":[
      {
         "Key":"fullViewLq1teqJ1Ym-nHGwcJtRuL-1433857991.895335.mp4",
         "Rotate":"0",
         "PresetId":"1351620000001-000030"
      }
   ],
   "PipelineId":"xxxxxxxxx-xxxx"
 },
    success: function(httpResponse) {
            // console.log(httpResponse);

            alert("Worked TRANCODER");
            response.success();
            },
        error: function(httpResponse) {
            // console.error(httpResponse);
            alert("Did not work TRANSCODER");
            response.error(httpResponse);
        }
 
    });


});

我可以看到我的 url 可能是错误的,但那是因为我无法从他们的文档中确定我应该将请求发送到哪个 url:http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html#create-job-description

这是我得到的回应:

{"uuid":"7dd5e323-167f-fe75-ca64-0adeeebad099","status":0,"headers":{"Connection":"keep-alive","Content-Language":"en","Content-Length":"3871","Content-Type":"text/html","Date":"Tue, 09 Jun 2015 14:44:23 GMT","Mime-Version":"1.0","Server":"squid/3.1.19","Vary":"Accept-Language","X-Squid-Error":"ERR_DNS_FAIL 0"},"text":"Request failed; 56-111 Failure when receiving data from the peer; Connection refused","buffer":[],"cookies":{}}

任何关于如何做的反馈都会很棒。

谢谢。

【问题讨论】:

  • 这个我也搞定了,找了好久。似乎它可能是新事物,这让我认为它可能是一个错误?

标签: javascript amazon-web-services parse-platform httprequest amazon-elastic-transcoder


【解决方案1】:

这里有几件事:

  • 您不能在不签署请求的情况下仅发布到弹性转码器端点。所有 AWS 服务都要求您签署请求。见这里:http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html
  • 您可能不应该在标题中指定 HostContent-Length
  • 输出键和输入键一样有点混乱
  • 您可能应该展示如何创建管道以确保完整性。

【讨论】:

  • 是否可以举个例子说明它的外观?输出密钥与输入相同,因为它只用于压缩,并且有一个压缩视频的文件夹。
猜你喜欢
  • 2015-01-31
  • 1970-01-01
  • 2015-01-22
  • 2016-03-25
  • 2020-11-15
  • 1970-01-01
  • 1970-01-01
  • 2022-11-08
  • 1970-01-01
相关资源
最近更新 更多