0

I am creating a Node api to convert .mp4 file to .wav file using AWS MediaConvert. I need to add some metadata to the output .wav file but I am not able to figure out how to do so.

Is there any specific MediaConvert setting that I need to configure while creating a MediaConvert Job for the transcoding which will allow me to add the metadata to the .wav file?

I am currently having the following setting for my MediaConvert Job:

const mediaConvertSetting = {
Queue: queue-arn,
Role: role-arn,
Settings: {
  Inputs: [
    {
      AudioSelectors: {
        "Audio Selector 1": {
          DefaultSelection: "DEFAULT",
        },
      },
      VideoSelector: {},
      TimecodeSource: "ZEROBASED",
      FileInput: `s3://source-bucket/input_file.mp4`,
    },
  ],
  TimecodeConfig: {
    Source: "ZEROBASED",
  },
  OutputGroups: [
    {
      Name: "File Group",
      Outputs: [
        {
          ContainerSettings: {
            Container: "RAW",
          },
          AudioDescriptions: [
            {
              AudioTypeControl: "FOLLOW_INPUT",
              AudioSourceName: "Audio Selector 1",
              CodecSettings: {
                Codec: "WAV",
                WavSettings:  {
                  BitDepth: '16',
                  Channels: '1',
                  Format: 'RIFF',
                  SampleRate: '8000'
                }
              },
              LanguageCodeControl: "FOLLOW_INPUT",
              AudioType: 0,
            },
          ],
          Extension: "wav",
          NameModifier: "_wav",
        },
      ],
      OutputGroupSettings: {
        Type: "FILE_GROUP_SETTINGS",
        FileGroupSettings: {
          Destination: `s3://destination-bucket/`,
          S3Settings: {
            AccessControl: {
              CannedAcl: "PUBLIC_READ"
            }
          }
        },
      },
    },
  ],
  TimedMetadataInsertion: {
    Id3Insertions: [
      {
        Id3: base64EncodedTestMetadata,
        Timecode: '00:00:00:01'
      },
    ]
  }
},
UserMetadata: {
  "Some Metadata": "TEST",
},
WizRd AM
  • 3
  • 3

1 Answers1

0

At present MediaConvert cannot set metadata on the RAW container type.

A possible workflow alternative is to embed the desired metadata into the newly created WAV files in an automated fashion using an AWS Lambda function and ffmpeg.

If you would like to see this feature added to MediaConvert, please use the 'Feedback' button in the lower left of the AWS Console, and select 'Feature Request' in the resulting dialog box.

aws-robclem
  • 324
  • 2
  • 5
  • If I need AWS MediaConvert to convert the file and use FFMPEG to add metadata to it, is it better to just use FFMPEG to convert and add metadata and remove the use of MediaConvert entirely? Does ffmpeg has any upper hand over AWS MediaConvert other than the metadata part? – WizRd AM Sep 22 '22 at 09:08
  • Good question. FFMPEG is a powerful video encoding tool, but on its own it has no graphical interface, no output templates, no job queues, no preset groups, and no integration with AWS S3. Also, an ffmpeg command generally only produces a single output type in any one job, so if you needed three output renditions, you'd probably need three commands. For simplistic operations as described above, ffmpeg in a Lambda Fn works well. Note also, Lambda functions currently have a maximum execution lifetime of 15 minutes. – aws-robclem Sep 27 '22 at 18:07
  • Thank you for the clarity. One lats question, "At present MediaConvert cannot set metadata on the RAW container type" -> can we set metadata on any other container type? – WizRd AM Sep 28 '22 at 09:20