如何在 AWS Elemental MediaConvert 上转码带有 SRT 字幕的 MP4 视频

How to transcode MP4 video with SRT subtitle on AWS Elemental MediaConvert

我有一个带有 SRT 字幕的 MP4 视频,我需要使用媒体转换对其进行转码。在媒体转换中,我设置了自动 ABR 并指定了 SRT 原始路径。

目前,我测试了以下内容:

对于第一个测试,作业成功完成,但在 S3 存储桶上没有任何 .SRT 文件。对于第二个测试,作业失败并显示“aption destination type [SRT] requires a raw muxer”。留言

这是我的JSON第一次测试

{
  "Queue": "arn:aws:mediaconvert:us-east-1:{{ACCOUNT-NUMBER}}:queues/Default",
  "UserMetadata": {},
  "Role": "arn:aws:iam::{{ACCOUNT-NUMBER}}:role/{{MY-ROLE-NAME}}",
  "Settings": {
    "TimecodeConfig": {
      "Source": "ZEROBASED"
    },
    "OutputGroups": [
      {
        "Name": "DASH ISO",
        "Outputs": [
          {
            "ContainerSettings": {
              "Container": "MPD"
            },
            "VideoDescription": {
              "ScalingBehavior": "DEFAULT",
              "TimecodeInsertion": "DISABLED",
              "AntiAlias": "ENABLED",
              "Sharpness": 50,
              "CodecSettings": {
                "Codec": "H_264",
                "H264Settings": {
                  "InterlaceMode": "PROGRESSIVE",
                  "ScanTypeConversionMode": "INTERLACED",
                  "NumberReferenceFrames": 3,
                  "Syntax": "DEFAULT",
                  "Softness": 0,
                  "GopClosedCadence": 1,
                  "GopSize": 90,
                  "Slices": 1,
                  "GopBReference": "DISABLED",
                  "SlowPal": "DISABLED",
                  "EntropyEncoding": "CABAC",
                  "FramerateControl": "INITIALIZE_FROM_SOURCE",
                  "RateControlMode": "QVBR",
                  "CodecProfile": "MAIN",
                  "Telecine": "NONE",
                  "MinIInterval": 0,
                  "AdaptiveQuantization": "AUTO",
                  "CodecLevel": "AUTO",
                  "FieldEncoding": "PAFF",
                  "SceneChangeDetect": "ENABLED",
                  "QualityTuningLevel": "MULTI_PASS_HQ",
                  "FramerateConversionAlgorithm": "DUPLICATE_DROP",
                  "UnregisteredSeiTimecode": "DISABLED",
                  "GopSizeUnits": "FRAMES",
                  "ParControl": "INITIALIZE_FROM_SOURCE",
                  "NumberBFramesBetweenReferenceFrames": 2,
                  "RepeatPps": "DISABLED",
                  "DynamicSubGop": "STATIC"
                }
              },
              "AfdSignaling": "NONE",
              "DropFrameTimecode": "ENABLED",
              "RespondToAfd": "NONE",
              "ColorMetadata": "INSERT"
            },
            "AudioDescriptions": [
              {
                "AudioTypeControl": "FOLLOW_INPUT",
                "AudioSourceName": "Audio Selector 1",
                "CodecSettings": {
                  "Codec": "AAC",
                  "AacSettings": {
                    "AudioDescriptionBroadcasterMix": "NORMAL",
                    "Bitrate": 96000,
                    "RateControlMode": "CBR",
                    "CodecProfile": "LC",
                    "CodingMode": "CODING_MODE_2_0",
                    "RawFormat": "NONE",
                    "SampleRate": 48000,
                    "Specification": "MPEG4"
                  }
                },
                "StreamName": "latino",
                "LanguageCodeControl": "FOLLOW_INPUT",
                "LanguageCode": "SPA"
              }
            ]
          },
          {
            "ContainerSettings": {
              "Container": "MPD"
            },
            "CaptionDescriptions": [
              {
                "CaptionSelectorName": "Captions Selector 1",
                "DestinationSettings": {
                  "DestinationType": "SRT"
                },
                "LanguageCode": "SPA",
                "LanguageDescription": "latino"
              }
            ]
          }
        ],
        "OutputGroupSettings": {
          "Type": "DASH_ISO_GROUP_SETTINGS",
          "DashIsoGroupSettings": {
            "SegmentLength": 30,
            "MinFinalSegmentLength": 0,
            "Destination": "s3://{{BUCKET-NAME}}/streaming15/dash-iso/",
            "FragmentLength": 2,
            "SegmentControl": "SINGLE_FILE",
            "MpdProfile": "ON_DEMAND_PROFILE",
            "HbbtvCompliance": "NONE"
          }
        },
        "AutomatedEncodingSettings": {
          "AbrSettings": {
            "MaxAbrBitrate": 8000000,
            "MinAbrBitrate": 600000
          }
        }
      }
    ],
    "AdAvailOffset": 0,
    "Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "Offset": 0,
            "DefaultSelection": "DEFAULT",
            "ProgramSelection": 1
          }
        },
        "VideoSelector": {
          "ColorSpace": "FOLLOW",
          "Rotate": "DEGREE_0",
          "AlphaBehavior": "DISCARD"
        },
        "FilterEnable": "AUTO",
        "PsiControl": "USE_PSI",
        "FilterStrength": 0,
        "DeblockFilter": "DISABLED",
        "DenoiseFilter": "DISABLED",
        "InputScanType": "AUTO",
        "TimecodeSource": "ZEROBASED",
        "CaptionSelectors": {
          "Captions Selector 1": {
            "SourceSettings": {
              "SourceType": "SRT",
              "FileSourceSettings": {
                "SourceFile": "s3://{{BUCKET-NAME}}/PROMO_CAP_01.srt"
              }
            }
          }
        },
        "FileInput": "s3://{{BUCKET-NAME}}/PROMO_CAP_01.mp4"
      }
    ]
  },
  "AccelerationSettings": {
    "Mode": "DISABLED"
  },
  "StatusUpdateInterval": "SECONDS_60",
  "Priority": 0
}

我错过了什么?

根据 AWS Elemental MediaConvert 用户指南,当输入字幕类型为 SRT 时,SRT 不是 DASH-ISO 输出组支持的输出。

这是该指南的 link(参考第 176 页): https://docs.aws.amazon.com/mediaconvert/latest/ug/mediaconvert-guide.pdf

DASH-ISO 中 SRT 输入支持的字幕输出是:

  • 烙印
  • IMSC(作为 sidecar .fmp4)
  • IMSC(作为 sidecar .xml)
  • TTML(作为 sidecar .fmp4)
  • TTML(作为 sidecar .ttml)

此外,文档中存在漏洞。支持 SRT->DASH-ISO+WebVTT,尽管未列出。文档将得到更正,但我想与您分享,以防对您有所帮助。

如果您必须将 SRT 发送到输出目标,那么您可以创建一个单独的输出组,其中字幕位于没有容器的轨道中(请参阅文档中的第 192-196 页)。