我正在使用 aws-sdk-php 集成 Amazon s3 Elastic Transcoder。我用http://elastictranscoding.blogspot.in/链接来完成我的任务。在实现时我面临以下错误:
fatal error :未捕获的 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\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;
}
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":"*"
}
]
}
我认为我无权访问弹性转码器服务。请建议。提前致谢。
最佳答案
在创建作业“key”、“secret”、“region”之前验证您的详细信息
创建管道时检查管道区域, 可能是创建工作区域不同, 有时其他地区的用户无法通过不同的地区进行连接, 仔细检查需要凭据请确保您的管道区域和创建作业区域必须相同。
关于php - 亚马逊 s3 弹性转码器错误 : The specified pipeline was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20815250/