Luma mask cannot change position or size?

Hi all,

I need to use luma to circle crop a video. But the ratio of the luma changed when the image used as a luma.

But got some problems:

  1. When applying a 16:9 luma to a 9:16 video, the luma was resized automatically, But I need exactly the raw shape of the mask.
  2. I’m trying to scale, rotate the video, but the mask also rotate or scale with the video. Just need to adjust the video, not the mask, how to do that?
  3. How to change to offset/scale/rotate of the luma mask? I tried to modified these attribute of the luma clip, but doesn’t work.

The json pasted below:


{
  "timeline": {
    "soundtrack": {
      "src": "https://s3-ap-southeast-2.amazonaws.com/shotstack-assets/music/moment.mp3",
      "effect": "fadeOut"
    },
    "background": "#ffffff",
    "tracks": [
      {
        "clips": [
          {
            "asset": {
              "type": "luma",
              "src": "https://shotstack-assets.s3-ap-southeast-2.amazonaws.com/luma-mattes/static/circle-sd.jpg"
            },
            "start": 0.0,
            "length": 3.18
          },
          {
            "asset": {
              "type": "video",
              "src": "https://shotstack-api-stage-output.s3-ap-southeast-2.amazonaws.com/d86covx4fi/8a688b4d-c97e-4a59-977c-0fe9d7744fab.mp4",
              "volume": 1
            },
            "start": 0.0,
            "length": 3.18,
            "scale": 0.1,
            "transform": {
              "rotate": {
                "angle": 0.0
              }
            }
           
          }
        ]
      }
    ],
    "cache": false
  },
  "output": {
    "format": "mp4",
      "resolution": "hd",
    "aspectRatio": "9:16",
    "thumbnail": {
      "capture": 1,
      "scale": 0.5
    }
  }
}

Looking forward to replies.

Right now applying a luma “attaches” it to the video being masked, in such a way that it inherits the videos width and height. If you scale the width and height of the video the luma will also scale. Right now this is the intended behavior and we have no immediate plans to change this.

There are a couple of workarounds that might work for you:

  • Create multiple masks that are the same aspect ratio as the video you will be masking. If you need 16:9, 9:16 and 1:1 for example, create 3 different mask images.

  • Depending on your objective you might also be able to create an overlay image with a transparent window in it. So a PNG image with solid color and a transparent circle where you want it. Then you can scale, rotate and align the video behind the PNG image so that it appears through the transparent circle.

1 Like