0

I need to batch transcode thousands of of .webm audio files to e.g mp3.

I found a script here which I could adapt to my purpose.

However, where do I run such a script?

syntheso
  • 437
  • 3
  • 17
  • You could consider [S3 Batch Operations](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/batch-ops.html) with a lambda function. The function would run your code (after it gets adapted to lambda environment). – Marcin Jul 26 '20 at 09:20
  • So, I take e.g that script I linked to, adapt it for my purposes, then I adapt that code to lambda environment and run it in S3 batch operations? In other words, that script adapted to my purposes would not work. There is a step to make it appropriate for lambda? – syntheso Jul 26 '20 at 09:27
  • Yes, lambda function requires a [handler](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html). So you would have to add it to your code. – Marcin Jul 26 '20 at 09:30

1 Answers1

1

That script uses Amazon Elastic Transcoder.

Basically, you first create a pipeline in Elastic Transcoder, which tells it where to find the input files. Then, you create a job by specifying the input file and the desired output format. The job then runs for a while and the output file appears in the nominated S3 bucket.

I suggest you try it manually in the management console first. You can then write a script to automate the job creation (similar to the one you linked).

The script can run anywhere on the Internet.

You can create a script like that with any programming language (eg Python) or you could use the AWS Command-Line Interface. See: create-job — AWS CLI Command Reference

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thank you for answering me directly, I much appreciate it. I could even run the script locally then, right? – syntheso Jul 26 '20 at 11:49
  • Yes. A simple way is to make an Excel spreadsheet with the name of the files. Then, create a formula that calls Elastic Transcoder and requests one file to be converted. Test it and, if it works, copy that formula for all other files, then paste it into a command window. (Requires the [AWS Command-Line Interface (CLI)](http://aws.amazon.com/cli/) to be installed.) Or, write a script in a programming language of your choice. – John Rotenstein Jul 26 '20 at 21:08