Skip to content Skip to sidebar Skip to footer

Deleting A File After Transcoding With Aws Lambda And Elastic Transcoder

I'm using a Lambda python script to call Elastic Transcoder on a file that I upload. How do I delete the file after transcoding? At the moment, my code creates the job, and then d

Solution 1:

You basically have to poll Elastic Transcoder for the job's status (every 30 seconds, for example), and wait until the job is completed. Once the job is completed, you can delete your S3 source file.

Using boto3, you can retrieve a job's status like this:

transcoder = boto3.client('elastictranscoder')
job = transcoder.read_job(Id=job_id)
status = job['Job']['Status']

Or alternatively, you can use the job_complete waiter.

Post a Comment for "Deleting A File After Transcoding With Aws Lambda And Elastic Transcoder"