我正在使用 aws-sdk-php 集成 Amazon s3 Elastic Transcoder。我使用http://elastictranscoding.blogspot.in/链接来完成我的任务。在实施时我面临以下错误:
致命错误:未捕获的 Aws\ElasticTranscoder\Exception\ResourceNotFoundException:AWS 错误代码:ResourceNotFoundException,状态代码:404,AWS 请求 ID:820ccf2d-6fc3-11e3-85a1-cdbd862f75bb,AWS 错误类型:客户端,AWS 错误消息:指定的管道未找到:帐户=008180918836,pipelineId=1388230727728-l0b712.,用户代理:aws-sdk-php2/2.5.0 Guzzle/3.7.1 curl/7.29.0 PHP/5.4.12 扔在 D:\projects\ modelpeopledemo\amazon_upload\Aws\Common\Exception\NamespaceExceptionFactory.php 在第 91 行
创建工作代码:
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;
}
配置文件
{
"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":"*"
}
]
}
我认为我无权访问弹性转码器服务。请建议。预先感谢。