Search code examples
node.jsaws-sdkaws-media-convert

AWS Media Converter creates new job for each file?


I am working on AWS MediaConverter and trying to create a Node js API which converts .mp4 format to .wav format.

I have the api is working correctly, however it is creating a new job for each individual .mp4 file.

Is it possible to have one MediaConvert job and use that for every file in the input_bucket instead of creating a new job for every file?

I have tried going through AWS MediaConvert Documentation and various online articles, but I am not able to see any answer to my question.

I have tried to implement my api in following steps :

  • create an object of class
AWS.MediaConvert() 
  • create a job template using
MediaConvert.createJobTemplate
  • create a job using
MediaConvert.createJob

Solution

  • There is generally a 1 : 1 relationship between inputs and jobs in MediaConvert.

    A MediaConvert job reads an input video from S3 (or HTTP server) and converts the video to output groups that in turn can have multiple outputs. A single media convert job can create multiple versions of the input video in different codecs and packages.

    The exception to this is when you want to join more than one input file into a single asset (input stitching). In this case you can have up to 150 inputs in your job. AWS Elemental MediaConvert subsequently creates outputs by concatenating the inputs in the order that you specify them in the job.

    Your question does however suggests that input stitching is not what you are looking to achieve. Rather, you are looking to transcode multiple inputs from the source bucket. If so, you would need to create a job for each input.

    Job Templates (as well as Output Presets) work to speed up your job setup by providing groups of recommended transcoding settings. Job templates apply to an entire transcoding job whereas output presets apply to a single output of a transcoding job.

    References:

    1. Step 1: Specify your input files : https://docs.aws.amazon.com/mediaconvert/latest/ug/specify-input-settings.html
    2. Assembling multiple inputs and input clips with AWS Elemental MediaConvert : https://docs.aws.amazon.com/mediaconvert/latest/ug/assembling-multiple-inputs-and-input-clips.html
    3. Working with AWS Elemental MediaConvert job templates : https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-job-templates.html
    4. Working with AWS Elemental MediaConvert output presets : https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-presets.html