首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AWS MediaConvert: ImageInserter无法按预期工作

AWS MediaConvert: ImageInserter无法按预期工作
EN

Stack Overflow用户
提问于 2020-08-07 16:50:07
回答 1查看 481关注 0票数 1

我使用简单的无服务器视频点播模板在AWS上部署VOD解决方案。我更新了代码,将水印添加到所有将要处理的视频中。视频正在被转码,但水印仍然丢失,到目前为止,我已经尝试了两种方法:

  • 在输出预置中添加水印。
  • 添加水印作为进程输入的一部分。

但似乎都不起作用。测试视频的尺寸为320×240,这是正在生成的作业请求的内容:

代码语言:javascript
复制
{
  "Queue": "arn:aws:mediaconvert:us-east-1:account_id:queues/Default",
  "UserMetadata": {},
  "Role": "arn:aws:iam::account_id:role/project-profile-MediaConvertJobRole-HASH",
  "Settings": {
    "TimecodeConfig": {
      "Source": "EMBEDDED"
    },
    "OutputGroups": [
      {
        "Name": "HLS",
        "Outputs": [
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_480x270_15fps_400kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_480x270_15fps_400kbps"
          },
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_640x360_30fps_600kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_640x360_30fps_600kbps"
          },
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_640x360_30fps_1200kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_640x360_30fps_1200kbps"
          },
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_960x540_30fps_3500kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_960x540_30fps_3500kbps"
          },
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_1280x720_30fps_5000kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_1280x720_30fps_5000kbps"
          },
          {
            "Preset": "Custom-Ott_Hls_Ts_Avc_Aac_16x9_1920x1080_30fps_8500kbps",
            "NameModifier": "/Custom-Ott_Hls_Ts_Avc_Aac_16x9_1920x1080_30fps_8500kbps"
          }
        ],
        "OutputGroupSettings": {
          "Type": "HLS_GROUP_SETTINGS",
          "HlsGroupSettings": {
            "ManifestDurationFormat": "INTEGER",
            "SegmentLength": 4,
            "TimedMetadataId3Period": 10,
            "CaptionLanguageSetting": "OMIT",
            "Destination": "s3://project-profile-account_id-us-east-1/output/hls/samplebunny",
            "TimedMetadataId3Frame": "PRIV",
            "CodecSpecification": "RFC_4281",
            "OutputSelection": "MANIFESTS_AND_SEGMENTS",
            "ProgramDateTimePeriod": 600,
            "MinSegmentLength": 0,
            "DirectoryStructure": "SINGLE_DIRECTORY",
            "ProgramDateTime": "EXCLUDE",
            "SegmentControl": "SEGMENTED_FILES",
            "ManifestCompression": "NONE",
            "ClientCache": "ENABLED",
            "StreamInfResolution": "INCLUDE"
          }
        }
      },
      {
        "Name": "DASH ISO",
        "Outputs": [
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_480x270_15fps_400kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_480x270_15fps_400kbps"
          },
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_640x360_30fps_600kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_640x360_30fps_600kbps"
          },
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_640x360_30fps_1200kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_640x360_30fps_1200kbps"
          },
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_960x540_30fps_3500kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_960x540_30fps_3500kbps"
          },
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1280x720_30fps_5000kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1280x720_30fps_5000kbps"
          },
          {
            "Preset": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1920x1080_30fps_8500kbps",
            "NameModifier": "/Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1920x1080_30fps_8500kbps"
          },
          {
            "Preset": "System-Ott_Dash_Mp4_Aac_He_96Kbps",
            "NameModifier": "/preset-0_Ott_Dash_Mp4_Aac_He_96Kbps"
          }
        ],
        "OutputGroupSettings": {
          "Type": "DASH_ISO_GROUP_SETTINGS",
          "DashIsoGroupSettings": {
            "SegmentLength": 4,
            "Destination": "s3://project-profile-account_id-us-east-1/output/dash/samplebunny",
            "FragmentLength": 2,
            "SegmentControl": "SEGMENTED_FILES",
            "HbbtvCompliance": "NONE"
          }
        }
      }
    ],
    "AdAvailOffset": 0,
    "Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "Tracks": [
              1
            ],
            "Offset": 0,
            "DefaultSelection": "NOT_DEFAULT",
            "SelectorType": "TRACK",
            "ProgramSelection": 1
          }
        },
        "VideoSelector": {
          "ColorSpace": "FOLLOW"
        },
        "FilterEnable": "AUTO",
        "PsiControl": "USE_PSI",
        "FilterStrength": 0,
        "DeblockFilter": "DISABLED",
        "DenoiseFilter": "DISABLED",
        "TimecodeSource": "EMBEDDED",
        "ImageInserter": {
          "InsertableImages": [
            {
              "Width": 100,
              "Height": 31,
              "ImageX": 0,
              "ImageY": 0,
              "Layer": 20,
              "ImageInserterInput": "s3://project-profile-account_id-us-east-1/watermark.png",
              "StartTime": "00:00:00:00",
              "Opacity": 100
            }
          ]
        },
        "FileInput": "s3://project-profile-account_id-us-east-1/input/samplebunny.mp4"
      }
    ]
  },
  "AccelerationSettings": {
    "Mode": "DISABLED"
  },
  "StatusUpdateInterval": "SECONDS_60",
  "Priority": 0
}

这是生成的输出预设之一:

代码语言:javascript
复制
{
  "Description": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1280x720_30fps_5000kbps",
  "Category": "OTT-DASH",
  "Name": "Custom-Ott_Dash_Mp4_Avc_Aac_16x9_1280x720_30fps_5000kbps",
  "Settings": {
    "VideoDescription": {
      "Width": 1280,
      "ScalingBehavior": "DEFAULT",
      "Height": 720,
      "VideoPreprocessors": {
        "ImageInserter": {
          "InsertableImages": [
            {
              "Width": 100,
              "Height": 31,
              "ImageX": 0,
              "ImageY": 0,
              "Layer": 20,
              "ImageInserterInput": "s3://project-profile-account_id-us-east-1/watermark.png",
              "StartTime": "00:00:00:00",
              "Opacity": 50
            }
          ]
        }
      },
      "TimecodeInsertion": "DISABLED",
      "AntiAlias": "ENABLED",
      "Sharpness": 50,
      "CodecSettings": {
        "Codec": "H_264",
        "H264Settings": {
          "InterlaceMode": "PROGRESSIVE",
          "ParNumerator": 1,
          "NumberReferenceFrames": 3,
          "Syntax": "DEFAULT",
          "FramerateDenominator": 1001,
          "GopClosedCadence": 1,
          "HrdBufferInitialFillPercentage": 90,
          "GopSize": 90,
          "Slices": 1,
          "GopBReference": "ENABLED",
          "HrdBufferSize": 10000000,
          "SlowPal": "DISABLED",
          "ParDenominator": 1,
          "SpatialAdaptiveQuantization": "ENABLED",
          "TemporalAdaptiveQuantization": "ENABLED",
          "FlickerAdaptiveQuantization": "ENABLED",
          "EntropyEncoding": "CABAC",
          "Bitrate": 5000000,
          "FramerateControl": "SPECIFIED",
          "RateControlMode": "CBR",
          "CodecProfile": "HIGH",
          "Telecine": "NONE",
          "FramerateNumerator": 30000,
          "MinIInterval": 0,
          "AdaptiveQuantization": "HIGH",
          "CodecLevel": "LEVEL_4",
          "FieldEncoding": "PAFF",
          "SceneChangeDetect": "ENABLED",
          "QualityTuningLevel": "MULTI_PASS_HQ",
          "FramerateConversionAlgorithm": "DUPLICATE_DROP",
          "UnregisteredSeiTimecode": "DISABLED",
          "GopSizeUnits": "FRAMES",
          "ParControl": "SPECIFIED",
          "NumberBFramesBetweenReferenceFrames": 3,
          "RepeatPps": "DISABLED"
        }
      },
      "AfdSignaling": "NONE",
      "DropFrameTimecode": "ENABLED",
      "RespondToAfd": "NONE",
      "ColorMetadata": "INSERT"
    },
    "ContainerSettings": {
      "Container": "MPD"
    }
  }
}

如有任何意见,将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2020-08-12 22:54:44

我看到您将TimecodeConfig和TimecodeSource设置为EMBEDDED。我还注意到您的图像插入器都是从00:00:00开始的。

MediaConvert将在视频本质的SEI头中查找基于嵌入式时间码的时间编码。你能检查一下你的mp4文件,看看它是否有嵌入的时间码。或者尝试使用并将TimecodeConfig和TimecodeSource切换到ZEROBASED重新运行您的工作流。这将告诉服务从0开始,然后向上移动。

请注意,MP4和MOV文件可能包含一个tcmd框(原子)。但是,像MediaInfo这样的普通读取器会将其视为时间编码,并将其显示为一个单独的轨道。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63306120

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档