我正在使用aws-sdk-php集成Amazon s3 Elastic Transcoder.我使用http://elastictranscoding.blogspot.in/ link来完成我的任务.在实施i面临以下错误时:
致命错误:未捕获的Aws\ElasticTranscoder\Exception\ResourceNotFoundException:AWS错误代码:ResourceNotFoundException,状态代码:404,AWS请求ID:820ccf2d-6fc3-11e3-85a1-cdbd862f75bb,AWS错误类型:客户端,AWS错误消息:指定的管道未找到:account = 008180918836,pipelineId = 1388230727728-l0b712.,用户代理:aws -sdk-php2/2.5.0 Guzzle/3.7.1 curl/7.29.0 PHP/5.4.12抛出D:\ projects \第91行上的modelpeopledemo\amazon_upload\Aws\Common\Exception\NamespaceExceptionFactory.php
创建工作代码:
require 'aws-autoloader.php'; use Aws\ElasticTranscoder\ElasticTranscoderClient; $aws = Aws\Common\Aws::factory('config.json'); createjob('trailer_480p.mp4'); exit; function createjob($fname){ $aws = Aws\Common\Aws::factory('config.json'); $client = ElasticTranscoderClient::factory(array( 'key' => 'IAM user's public key', 'secret' => 'IAM user's secret key', 'region' => 'us-east-1' ) ); // Create a new transcoding job $file_name = $fname; $file_name_explode = explode( '.', $file_name ); $webm_transcode_request = $client->createJob( array( 'PipelineId' => 'my pipeline id', 'Input' => array( 'Key' => $fname, 'FrameRate' => 'auto', 'Resolution' => 'auto', 'AspectRatio' => 'auto', 'Interlaced' => 'auto', 'Container' => 'auto', ), 'Output' => array( 'Key' => 'trailer_480p.mp4', 'ThumbnailPattern' => $file_name_explode[0] . '-700thumb-{resolution}-{count}', 'Rotate' => '0', 'PresetId' => '1351620000001-000020' ) ) ); return $webm_transcode_request; }
config.json
{ "includes": ["_aws"], "services": { "default_settings": { "params": { "key": "AWS public key", "secret": "AWS secret key", "region": "us-east-1" } } } }
我的用户政策是:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "elastictranscoder:*", "s3:*", "iam:*", "sns:*" ], "Resource": "*" } ] }
我的用户组的政策是:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Sid", "Effect": "Allow", "Action": "*", "Resource":"*" } ] }
我想我无权访问弹性转码器服务.请建议.预先感谢.
在创建作业"密钥","秘密","区域"之前验证您的详细信息,
在创建管道时检查管道区域,可能是创建作业区域不同,有些时候其他区域用户无法通过不同区域连接,请仔细检查要求凭据请确保您的管道区域和创建作业区域必须相同.