1

我正在使用Simple Serverless Video On Demand 模板在 AWS 上部署 VOD 解决方案。我更新了代码,为所有正在处理的视频添加水印。视频正在转码,但水印仍然丢失,到目前为止,我尝试了两种方法:

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

但似乎没有一个工作。测试视频的尺寸为 320 × 240,这是正在生成的作业请求的内容:

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

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

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

任何输入将不胜感激。

4

1 回答 1

0

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

MediaConvert 将在视频 essense 的 SEI 标头中查找基于嵌入的时间码的时间码。你能查看你的 mp4 文件,看看它是否真的有嵌入的时间码。或者尝试使用并将 TimecodeConfig 和 TimecodeSource 切换为 ZEROBASED 重新运行您的工作流程。这将告诉服务从 0 开始并打勾。

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

于 2020-08-12T22:54:44.740 回答