0

Just wanted to know How I handle a video trimming from AWS Elemental MediaConvert when the user upload's a video file through JavaScript

virendra parade
  • 141
  • 2
  • 12

1 Answers1

1

MediaConvert requires you to set the SDK to use a specific API input [1,2]

The JavaScript SDK docs [3] call out how to define and create a job in MeidaConvert using the JS SDK. In order to accomplish input clipping you would need to add the InputClippings option to your Input JSON block. An example is below:

"Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "Offset": 0,
            "DefaultSelection": "NOT_DEFAULT",
            "ProgramSelection": 1,
            "SelectorType": "TRACK",
            "Tracks": [
              1
            ]
          }
        },
        "VideoSelector": {
          "ColorSpace": "FOLLOW"
        },
        "FilterEnable": "AUTO",
        "PsiControl": "USE_PSI",
        "FilterStrength": 0,
        "DeblockFilter": "DISABLED",
        "DenoiseFilter": "DISABLED",
        "TimecodeSource": "ZEROBASED",
        "FileInput": "s3://INPUT_BUCKET_AND_FILE_NAME",
        "InputClippings": [
          {
            "StartTimecode": "00:00:00:00",
            "EndTimecode": "00:05:00:00"
          }
        ]
      }
    ]

Keep in mind that TimecodeSource will affect clipping regions. If you know the source file your user is uploading contains embedded timecode, you can change this to EMBEDDED, for more information see the documentation [4]

== Resources ==
[1] https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/emc-examples-jobs.html#emc-examples-jobs-configure-sdk
[2] https://docs.aws.amazon.com/mediaconvert/latest/apireference/custom-endpoints.html
[3]https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/emc-examples-jobs.html#emc-examples-jobs-spec
[4] https://docs.aws.amazon.com/mediaconvert/latest/ug/setting-up-an-assembly-workflow-job.html

jjohn
  • 233
  • 1
  • 3
  • jjohn can u please look into link shared below and let me know suggestions https://stackoverflow.com/questions/67402231/aws-elemental-mediaconvert-createjob-example-using-the-aws-sdk-for-net – virendra parade May 05 '21 at 13:40