aws transcoder overwrite files on s3

0 votes

I'm using the AWS PHP SDK to upload a file to S3 and then transcode it with Elastic Transcoder.

First pass everything works fine, the putobject command overwrites the old file (always named the same) on s3:

$s3->putObject([ 'Bucket' => Config::get('app.aws.S3.bucket'), 'Key' => $key, 'SourceFile' => $path, 'Metadata' => [ 'title' => Input::get('title') ] ]);

However, when creating a second transcoding job, i get the error:

The specified object could not be saved in the specified bucket because an object by that name already exists

the transcoder role has full s3 access. Is there a way around this or will i have to delete the files using the SDK every time before it's transcoded?

My create job:

$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') ], ]);

Apr 12, 2022 in IoT (Internet of Things) by Soham
• 9,710 points
591 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

I can think of two ways to implement it:

  1. Create two buckets, one for temp file storage (where it's uploaded) and another where the transcoded file is placed. Post transcoding when a new file is created, you can delete the temp file.

  2. Use a single bucket and upload the file with some suffix/prefix. Create transcoded file in the same bucket removing prefex/suffix.

In both cases for automated deletion of uploaded files, you can use the Lambda function with S3 notifications.

answered Apr 13, 2022 by Aditya
• 7,680 points

edited Mar 5

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Best Practices on AWS IoT

I would recommend you use Case 2 ...READ MORE

answered Dec 26, 2018 in IoT (Internet of Things) by Shubham
• 13,490 points
1,619 views
0 votes
1 answer
0 votes
0 answers

How to integrate AWS-XRay for others AWS services as SQS, S3

I am doing the same as the ...READ MORE

Apr 12, 2022 in IoT (Internet of Things) by Soham
• 9,710 points
1,013 views
0 votes
1 answer

USB Mobile Broadband Modem on Windows 10 IoT

I was looking for a solution too, ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
2,882 views
0 votes
1 answer

aws iot describe-endpoint::You must specify a region

This fixed the problem: Browse to https://console.aws.amazon.com/iam/home?region=us-west-2#security_credentialand then if ...READ MORE

answered Jul 11, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,348 views
0 votes
1 answer

Autostart published Application on Windows 10 IoT

It can be done by making changes ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
1,974 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP