In this tutorial, I will show you how to convert a video to a mp3 file using r. How can we do that ? Youtube AWS Elastic Transcode We will create a to consume events published by . For any video uploaded to a bucket, will invoke our function by passing event information. executes the function. As the function executes, it reads the event data, logs some of the event information to . Then, kick off a transcoding job. Lambda function S3 S3 Lambda AWS Lambda S3 Amazon CloudWatch Let’s start, by creating an to store the files (videos) and the files (audio) : S3 bucket inputs outputs Next, let’s define a . A pipeline essentially defines a queue for future transcoding . To create a pipeline, we need to specify the input bucket (where the videos will be). Transcoder pipeline jobs Note: Copy down the , we will need later on Pipeline ID Having created a pipeline, go to the , navigate to service & click on “ “, add as the event source for function: AWS Management Console Lambda Create a Lambda Function S3 Lambda I used the following : Node.JS code The script does the following: Extract the filename of the uploaded file from the event object Create a b and specify the required outputs Transcoder jo Launch the job Note: you might notice in the function above is the use of presets ( ). It describes how to encode the given file (in this case mp3). The full list of available presets can be found in . 1351620000001–300040 AWS Documentation Finally, set the as an and select an role with permission to access : pipeline id envrionment variable IAM Elastic Transcoder Once created, upload a video file to the bucket: inputs aws s3 cp way_down_we_go.3gp s3://slowcoder-videos/inputs/ If everything went well, you should see the file in your bucket: outputs will trigger our function. It will then execute our function. and log the object name to : S3 Lambda S3 CloudWatch Logs After couple of seconds (or minutes depends on the size of the video ) , you should see a new file has been generated by inside the directory in the : MP3 Elastic Transcoder job outputs S3 bucket