AWS PHP SDK を使用してファイルを S3 にアップロードし、Elastic Transcoder でトランスコードしています。
最初のパスはすべて正常に動作し、putobject コマンドは s3 上の古いファイル (常に同じ名前) を上書きします。
$s3->putObject([
'Bucket' => Config::get('app.aws.S3.bucket'),
'Key' => $key,
'SourceFile' => $path,
'Metadata' => [
'title' => Input::get('title')
]
]);
ただし、2 番目のトランスコード ジョブを作成すると、次のエラーが表示されます。
The specified object could not be saved in the specified bucket because an object by that name already exists
トランスコーダーの役割には、完全な s3 アクセス権があります。これを回避する方法はありますか、それともトランスコードする前に毎回 SDK を使用してファイルを削除する必要がありますか?
私の作成ジョブ:
$result = $transcoder->createJob([
'PipelineId' => Config::get('app.aws.ElasticTranscoder.PipelineId'),
'Input' => [
'Key' => $key
],
'Output' => [
'Key' => 'videos/'.$user.'/'.$output_key,
'ThumbnailPattern' => 'videos/'.$user.'/thumb-{count}',
'Rotate' => '0',
'PresetId' => Config::get('app.aws.ElasticTranscoder.PresetId')
],
]);