0

只是想知道当用户通过 JavaScript 上传视频文件时,我如何处理来自 AWS Elemental MediaConvert 的视频修剪

4

1 回答 1

1

MediaConvert 要求您将 SDK 设置为使用特定的 API 输入 [1,2]

JavaScript SDK 文档 [3] 介绍了如何使用 JS SDK 在 MeidaConvert 中定义和创建作业。为了完成输入剪辑,您需要将InputClippings选项添加到InputJSON 块。下面是一个例子:

"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"
          }
        ]
      }
    ]

请记住,这TimecodeSource会影响剪辑区域。如果您知道您的用户上传的源文件包含嵌入的时间码,您可以将其更改为EMBEDDED,有关更多信息,请参阅文档 [4]

== 资源 ==
[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-指南/emc-examples-jobs.html#emc-examples-jobs-spec
[4] https://docs.aws.amazon.com/mediaconvert/latest/ug/setting-up-an-assembly-workflow-job。 html

于 2021-05-04T16:13:21.533 回答