amazon web services - AWS MediaConvert - Position Overlay Image Relatively to Video Dimensions - Stack Overflow

I am using AWS MediaConvert to transcode user-uploaded videos and overlay a logo in the bottom-right co

I am using AWS MediaConvert to transcode user-uploaded videos and overlay a logo in the bottom-right corner. However, I am struggling to position the image dynamically relative to the video's resolution.

What I Want to Achieve:

  • The logo should always be positioned in the bottom-right corner, regardless of the video's resolution or aspect ratio.
  • The logo should scale proportionally based on the video dimensions.
  • The solution must work for both horizontal (landscape) and vertical (portrait) videos.
  • I cannot pre-calculate the video resolution before sending the job.

What I Have Tried:

AWS MediaConvert does not allow percentage-based positioning (e.g., sourceWidth - overlayWidth - 10). It only accepts absolute pixel values for ImageX and ImageY.

Currently, my configuration works fine for standard 1280x720 videos:

"VideoPreprocessors": {
  "ImageInserter": {
    "InsertableImages": [
      {
        "ImageInserterInput": "s3://my-bucket/logo.png",
        "Width": 200,
        "Height": 100,
        "ImageX": 1080,
        "ImageY": 580,
        "Layer": 1,
        "Opacity": 50,
        "StartTime": 0
      }
    ]
  }
}

However, this approach fails when processing videos of different resolutions:

  • If the video is 1920x1080, the logo is too small and appears in the wrong place.
  • If the video is vertical (e.g., 720x1280), the logo gets cut off or misplaced.
  • AWS MediaConvert does not seem to provide any built-in way to dynamically position the overlay.

Questions:

  1. Is there any way to dynamically position the overlay image relative to the video's resolution, without knowing the resolution beforehand?
  2. Are there any hidden options or workarounds in AWS MediaConvert that allow for relative positioning?
  3. If not, how can I achieve this without having to download the video to check its resolution before processing?

Any guidance would be much appreciated! Thanks.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745282302a4620347.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信