我正在尝试将文件上传到S3并使用弹性编码器对其进行转码
我的存储桶和管道处于活动状态,我可以将文件上传到输入存储桶
我一直在createJob函数上出现错误
$result = $client->createJob(array(
'PipelineId' => 'pipe.1',
'Input' => array(
'Key' => $counter[10],
'FrameRate' => 'auto',
'Resolution' => 'auto',
'AspectRatio' => 'auto',
'Interlaced' => 'auto',
'Container' => 'auto',
),
'Outputs' => array(
array(
'Key' => $counter[10].".out",
'ThumbnailPattern' => $counter[10],
'Rotate' => 'auto',
'PresetId' => '1351620000001-000001',
)
// ... repeated
),
));
我删除了此函数中的大多数其他参数,因为我不需要它们。
编辑: 异常'Guzzle \ Common \ Exception \ InvalidArgumentException',在phar:///home/prosoccerdata/apps/demo/assets/plugins/aws/aws.phar/Guzzle/Service/Client中显示消息'找不到匹配CreateJob的命令'。 PHP:87 堆栈跟踪:
phar:///home/prosoccerdata/apps/demo/assets/plugins/aws/aws.phar/Guzzle/Service/Client.php(76):Guzzle \ Service \ Client-> getCommand('CreateJob' ,数组)
PHAR:///home/prosoccerdata/apps/demo/assets/plugins/aws/aws.phar/Aws/Common/Client /AbstractClient.php(105):Guzzle \ Service \ Client-> __ call('CreateJob',Array)
/home/prosoccerdata/apps/demo/beeldbank/beheer/upload.php(179):Aws \ Common \ Client \ AbstractClient-> __ call('createJob',Array)
/home/prosoccerdata/apps/demo/beeldbank/beheer/upload.php(179):Aws \ S3 \ S3Client-> createJob(Array) {主要}
答案 0 :(得分:0)
我有同样的新手问题。您必须将S3Client更改为ElasticTranscoderClient。
use Aws\ElasticTranscoder\ElasticTranscoderClient;
$client = ElasticTranscoderClient::factory(array());
$result = $client->CreateJob(array());
我希望它有所帮助。