All Products
Search
Document Center

Intelligent Media Services:Image and video editing

Last Updated:Aug 19, 2026

Configure Timeline parameters in the SubmitMediaProducingJob operation to edit and mix images and videos.

Usage notes

  • Intelligent production supports editing and compositing, effect rendering, and templates for live streams, VOD files, and material files from Object Storage Service (OSS). For more information, see Overview of intelligent production.

  • You can produce a video from one or more videos, audio files, images, and subtitle materials by configuring Timeline parameters and calling the SubmitMediaProducingJob operation.

  • A timeline is created when you add materials and configure effects to create a video. A timeline consists of tracks, materials, and effects. For more information, see Timeline configurations.

  • For more information about how to use the IMS SDK to edit audio and video files, see Get started.

Set the output resolution

Call the SubmitMediaProducingJob operation to submit a video editing job. Set `Width` and `Height` in `OutputMediaConfig` to define the output resolution.

String outputMediaUrl = "https://your-bucket.oss-cn-shanghai.aliyuncs.com/target_video.mp4";
String outputMediaConfig = "{\"MediaURL\":\"" + outputMediaUrl + "\",\"Width\":720,\"Height\":1280}";
SubmitMediaProducingJobRequest request = new SubmitMediaProducingJobRequest();
request.setTimeline("<your-timeline>");
request.setOutputMediaConfig(outputMediaConfig);
SubmitMediaProducingJobResponse response = iceClient.submitMediaProducingJob(request);

Convert a landscape video to portrait and add black bars

When a landscape video is output in portrait orientation, the system proportionally scales and centers the material in the frame.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4"
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4"
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4"
    }]
  }]
}

Convert a landscape video to portrait and add blurred areas

`Radius` accepts values from 0.01 to 1. Supported values are listed in Effect Type: Background settings.

Final effect

Timeline example

{
	"VideoTracks": [{
		"VideoTrackClips": [{
			"MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
			"Effects": [{
				"Type": "Background",
				"SubType": "Blur",
				"Radius": 0.1
			}]
		}, {
			"MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
			"Effects": [{
				"Type": "Background",
				"SubType": "Blur",
				"Radius": 0.1
			}]
		}, {
			"MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
			"Effects": [{
				"Type": "Background",
				"SubType": "Blur",
				"Radius": 0.1
			}]
		}]
	}]
}

Convert a landscape video to portrait with a three-split screen effect

`AdaptMode=Cover` scales material to fill the target area while keeping its aspect ratio. Other values are listed in VideoTrackClip.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.3333,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.3333,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.3333,
      "AdaptMode": "Cover"
    }]
  },{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0,
      "AdaptMode": "Cover"
    }]
  },{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.6666,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.6666,
      "AdaptMode": "Cover"
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.6666,
      "AdaptMode": "Cover"
    }]
  }],
  "SubtitleTracks":[
    {
      "SubtitleTrackClips": [
        {
          "Type": "Text",
          "X": 0,
          "Y": 200,
          "Font": "AlibabaPuHuiTi",
          "Content": "This is the title",
          "Alignment": "TopCenter",
          "FontSize": 80,
          "FontColorOpacity": 1,
          "1FontColor": "#ffffff",
          "FontColor": "#FFDEAD",
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        }
      ]
    },
    {
      "SubtitleTrackClips": [
        {
          "Type":"Text",
          "X": 0,
          "Y": 320,
          "Font": "KaiTi",
          "Content": "This is the subtitle",
          "Alignment": "TopCenter",
          "FontSize": 45,
          "FontColor": "#ffffff",
          "FontFace": {
            "Bold": false,
            "Italic": true,
            "Underline": true
          }
        }
      ]
    },
    {
      "SubtitleTrackClips":[
        {
          "Type":"Text",
          "X": 0,
          "Y": 900,
          "Font": "AlibabaPuHuiTi",
          "Content": "You can add captions during video merging.\nUse a line feed to display text on multiple lines.",
          "Alignment": "TopCenter",
          "FontSize": 40,
          "FontColor": "#ffffff",
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        }
      ]
    }
  ]
}

Convert a landscape video to portrait and set the background color

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Effects": [{
        "Type": "Background",
        "SubType": "Color",
        "Color": "#000066"
      }]
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Effects": [{
        "Type": "Background",
        "SubType": "Color",
        "Color": "#006400"
      }]
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Effects": [{
        "Type": "Background",
        "SubType": "Color",
        "Color": "#8B1A1A"
      }]
    }]
  }]
}

Trim a video

`In=3` and `Out=8` trim the segment from 3s to 8s.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "In": 3,
      "Out": 8
    }]
  }]
}

Trim and merge multiple video segments

If you omit `TimelineIn` and `TimelineOut`, the system sequentially concatenates the materials.

If `MaxOut` is set to 5, up to 5 seconds of the material is used:

  • Material longer than 5 seconds: the first 5 seconds are used.

  • Material shorter than 5 seconds: the entire material is used.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "In": 3,
      "Out": 8
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "MaxOut": 5
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Effects": [{
        "Type": "Clip",
        "SubType": "RandomClip",
        "ClipDuration": 5
      }]
    }]
  }]
}

Mix videos and images

The default value of `Type` is `Video`. To use an image material, set `Type` to `Image`.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Out": 3
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/01.jpg",
      "Type": "Image",
      "Duration": 3
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/02.jpg",
      "Type": "Image",
      "Duration": 3
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Out": 3
    }]
  }]
}

Add watermarks, stickers, or GIF stickers

For GIF images, set `DyncFrames` to the number of frames in the GIF.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Out": 5
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 5
    }, {
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
      "Out": 5
    }]
  },{
    "VideoTrackClips": [{
      "Type": "Image",
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/s1.png",
      "TimelineIn": 0,
      "Duration": 5,
      "X": 40,
      "Y": 40,
      "Width": 300,
      "Height": 150
    }, {
      "Type": "Image",
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/g2.gif",
      "TimelineIn": 5,
      "Duration": 5,
      "X": 20,
      "Y": 800,
      "Width": 200,
      "Height": 200,
      "DyncFrames": 8
    }, {
      "Type": "Image",
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/image/g1.gif",
      "TimelineIn": 10,
      "Duration": 5,
      "X": 400,
      "Y": 40,
      "Width": 200,
      "Height": 200,
      "DyncFrames": 8
    }]
  }]
}

Scale modes

`AdaptMode` accepts `Contain`, `Cover`, and `Fill`. VideoTrackClip.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.3333,
      "AdaptMode": "Cover",
      "Out": 5
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.3333,
      "AdaptMode": "Cover",
      "Out": 5
    }]
  },{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0,
      "AdaptMode": "Contain",
      "Out": 5
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0,
      "AdaptMode": "Contain",
      "Out": 5
    }]
  },{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.6666,
      "AdaptMode": "Fill",
      "Out": 5
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "Width": 1,
      "Height": 0.3333,
      "X": 0,
      "Y": 0.6666,
      "AdaptMode": "Fill",
      "Out": 5
    }]
  }],
  "SubtitleTracks":[
    {
      "SubtitleTrackClips":[
        {
          "Type":"Text",
          "X": 0,
          "Y": 0,
          "Font": "AlibabaPuHuiTi",
          "Content": "AdaptMode=Cover: The content is scaled to fill the entire target area while maintaining its aspect ratio. If the object's aspect ratio does not match the content box, the object is cropped to fit.",
          "FontSize": 30,
          "FontColor": "#ffffff",
          "AdaptMode": "AutoWrap",
          "TextWidth": 1,
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        }
      ]
    },
    {
      "SubtitleTrackClips":[
        {
          "Type":"Text",
          "X": 0,
          "Y": 0.3333,
          "Font": "AlibabaPuHuiTi",
          "Content": "AdaptMode=Contain: The content is scaled to fit within the target area while preserving its aspect ratio.",
          "FontSize": 30,
          "FontColor": "#ffffff",
          "AdaptMode": "AutoWrap",
          "TextWidth": 1,
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        }
      ]
    },
    {
      "SubtitleTrackClips":[
        {
          "Type":"Text",
          "X": 0,
          "Y": 0.6666,
          "Font": "AlibabaPuHuiTi",
          "Content": "AdaptMode=Fill: This is the default behavior. The content is sized to fill the target content box exactly. The entire object completely fills the box. If the object's aspect ratio does not match the content box, the object is stretched to fit.",
          "FontSize": 30,
          "FontColor": "#ffffff",
          "AdaptMode": "AutoWrap",
          "TextWidth": 1,
          "FontFace": {
            "Bold": true,
            "Italic": false,
            "Underline": false
          }
        }
      ]
    }
  ]
}

Picture-in-picture

In `VideoTracks`, later tracks have a higher layer level and overlay earlier tracks.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4"
    }]
  },{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "X": 0.25,
      "Y": 0.25,
      "Width": 0.5,
      "Height": 0.5
    }]
  }]
}

Horizontal and vertical flips

Final effect

Timeline example

{
  "VideoTracks": [
    {
      "VideoTrackClips": [
        {
          "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
          "Width": 0.5,
          "Height": 0.5,
          "X": 0,
          "Y": 0,
          "Effects": [
            {
              "Type": "Text",
              "FixedX": 0,
              "FixedY": 0,
              "Font": "HappyZcool-2016",
              "Content": "Original video",
              "Alignment": "TopLeft",
              "FontSize": 80,
              "FontColor": "#F5FFFA",
              "TimelineIn": 0,
              "TimelineOut": 10,
              "Outline": 1,
              "OutlineColour": "#0e0100"
            }
          ]
        }
      ]
    },
    {
      "VideoTrackClips": [
        {
          "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
          "Width": 0.5,
          "Height": 0.5,
          "X": 0.5,
          "Y": 0,
          "Effects": [
            {
              "Type": "Flip",
              "Direction": "horizontal"
            },{
              "Type": "Text",
              "FixedX": 0.5,
              "FixedY": 0,
              "Font": "HappyZcool-2016",
              "Content": "Horizontal flip",
              "Alignment": "TopLeft",
              "FontSize": 80,
              "FontColor": "#F5FFFA",
              "TimelineIn": 0,
              "TimelineOut": 10,
              "Outline": 1,
              "OutlineColour": "#0e0100"
            }
          ]
        }
      ]
    },
    {
      "VideoTrackClips": [
        {
          "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
          "Width": 0.5,
          "Height": 0.5,
          "X": 0,
          "Y": 0.5,
          "Effects": [
            {
              "Type": "Flip",
              "Direction": "vertical"
            },{
              "Type": "Text",
              "FixedX": 0,
              "FixedY": 0.5,
              "Font": "HappyZcool-2016",
              "Content": "Vertical flip",
              "Alignment": "TopLeft",
              "FontSize": 80,
              "FontColor": "#F5FFFA",
              "TimelineIn": 0,
              "TimelineOut": 10,
              "Outline": 1,
              "OutlineColour": "#0e0100"
            }
          ]
        }
      ]
    },
    {
      "VideoTrackClips": [
        {
          "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
          "Width": 0.5,
          "Height": 0.5,
          "X": 0.5,
          "Y": 0.5,
          "Effects": [
            {
              "Type": "Flip",
              "Direction": "horizontal"
            },{
              "Type": "Flip",
              "Direction": "vertical"
            },{
              "Type": "Text",
              "FixedX": 0.5,
              "FixedY": 0.5,
              "Font": "HappyZcool-2016",
              "Content": "Horizontal and vertical flip",
              "Alignment": "TopLeft",
              "FontSize": 80,
              "FontColor": "#F5FFFA",
              "TimelineIn": 0,
              "TimelineOut": 10,
              "Outline": 1,
              "OutlineColour": "#0e0100"
            }
          ]
        }
      ]
    }
  ]
}

Crop a video

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "Out": 3,
      "X": 0.3,
      "Y": 0.3,
      "Width":0.4,
      "Height":0.4,
      "Effects": [{
        "Type":"Crop",
        "X":0.3,
        "Y":0.3,
        "Width":0.4,
        "Height":0.4
      },{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Crop by 60%",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "In": 3,
      "Out": 6,
      "X": 0.15,
      "Y": 0.15,
      "Width":0.7,
      "Height":0.7,
      "Effects": [{
        "Type":"Crop",
        "X":0.15,
        "Y":0.15,
        "Width":0.7,
        "Height":0.7
      },{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Crop by 30%",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    },{
      "MediaURL": "http://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
      "In": 6,
      "Out": 9,
      "Effects": [{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "No crop",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    }]
  }]
}

Change audio and video speed

`AudioTrackClips` also supports the `Speed` parameter for playback speed control.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3,
      "Effects": [{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Original speed",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA"
      }]
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Speed": 2,
      "Out": 6,
      "Effects": [{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "2x speed",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA"
      }]
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Speed": 3,
      "Out": 9,
      "Effects": [{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "3x speed",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA"
      }]
    }]
  }]
}

Rotate a material

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3,
      "Effects": [{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Original angle",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3,
      "X": 0,
      "Y": 0,
      "Height": 720,
      "Width": 1280,
      "Effects": [{
        "Type": "Rotate",
        "Degree": 90
      },{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Rotate 90 degrees",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3,
      "Effects": [{
        "Type": "Rotate",
        "Degree": 180
      },{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Rotate 180 degrees",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    },{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "Out": 3,
      "X": 0,
      "Y": 0,
      "Height": 720,
      "Width": 1280,
      "Effects": [{
        "Type": "Rotate",
        "Degree": 270
      },{
        "Type": "Text",
        "Font": "HappyZcool-2016",
        "Content": "Rotate 270 degrees",
        "FixedY": 150,
        "Alignment": "TopCenter",
        "FixedFontSize": 70,
        "FontColor": "#F5FFFA",
        "Outline": 1,
        "OutlineColour": "#0e0100"
      }]
    }]
  }]
}

Circle, rectangle, linear, and mirror masks

Final effect

Timeline example

{
    "VideoTracks": [
        {
            "VideoTrackClips": [
                {
                    "MediaUrl": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
                    "Width": 1,
                    "Height": 1,
                    "In": 0,
                    "Out": 5,
                    "AdaptMode": "Cover",
                    "Duration": 10
                }
            ]
        },
        {
            "VideoTrackClips": [
                {
                    "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
                    "X": 0.1,
                    "Y": 0.1,
                    "Width": 0.3,
                    "Height": 0.3,
                    "AdaptMode": "Cover",
                    "In": 0,
                    "Out": 5,
                    "Effects": [
                        {
                            "Type": "VFX",
                            "SubType": "mask_circle",
                            "ExtParams": "x=0.5,y=0.2,width=200.0,height=200.0,antialias=0.05"
                        }
                    ]
                }
            ]
        },
        {
            "VideoTrackClips": [
                {
                    "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
                    "X": 0.5,
                    "Y": 0.1,
                    "Width": 0.3,
                    "Height": 0.3,
                    "AdaptMode": "Cover",
                    "In": 0,
                    "Out": 5,
                    "Effects": [
                        {
                            "Type": "VFX",
                            "SubType": "mask_linear",
                            "ExtParams": "x=0.5,y=0.2,antialias=0.1,angle=90.0"
                        }
                    ]
                }
            ]
        },
        {
            "VideoTrackClips": [
                {
                    "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
                    "X": 0.1,
                    "Y": 0.5,
                    "Width": 0.3,
                    "Height": 0.3,
                    "AdaptMode": "Cover",
                    "In": 0,
                    "Out": 5,
                    "Effects": [
                        {
                            "Type": "VFX",
                            "SubType": "mask_minor",
                            "ExtParams": "x=0.5,y=0.4,size=0.6,angle=45.0"
                        }
                    ]
                }
            ]
        },
        {
            "VideoTrackClips": [
                {
                    "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.mp4",
                    "X": 0.5,
                    "Y": 0.5,
                    "Width": 0.3,
                    "Height": 0.3,
                    "AdaptMode": "Cover",
                    "In": 0,
                    "Out": 5,
                    "Effects": [
                        {
                            "Type": "VFX",
                            "SubType": "mask_rec",
                            "ExtParams": "x=0.5,y=200.0,width=200.0,height=200.0,radius=50.0,antialias=0.03"
                        }
                    ]
                }
            ]
        }
    ]
}

Parameter descriptions

  • Circle (ellipse)

    type = mask_circle

    Parameter

    Type

    Valid values

    Default value

    Description

    x

    float

    [0.0, material width]

    0.5

    The X coordinate of the mask's center within the material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    y

    float

    [0.0, material height]

    0.5

    The Y coordinate of the mask's center within the material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    width

    float

    [0.0, material width]

    0.8

    The width of the elliptical mask, relative to the material's width.

    • A value from 0.0 to 1.0 represents a width relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    height

    float

    [0.0, material height]

    0.8

    The height of the elliptical mask, relative to the material's height.

    • A value from 0.0 to 1.0 represents a height relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    antialias

    float

    [0.0, 1.0]

    0.1

    The anti-aliasing parameter for the elliptical mask. A larger value results in a higher degree of edge feathering.

    angle

    float

    [-9999.0, 9999.0]

    0.0

    The rotation angle.

  • Rectangle

    type = mask_rec

    Parameter

    Type

    Valid values

    Default value

    Description

    x

    float

    [0.0, material width]

    0.5

    The X coordinate of the rectangular mask's center within the video material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    y

    float

    [0.0, material height]

    0.5

    The Y coordinate of the rectangular mask's center within the video material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    width

    float

    [0.0, material width]

    0.8

    The width of the rectangular mask.

    • A value from 0.0 to 1.0 represents a width relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    height

    float

    [0.0, material height]

    0.8

    The height of the rectangular mask.

    • A value from 0.0 to 1.0 represents a height relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    antialias

    float

    [0.0, 1.0]

    0.1

    The anti-aliasing parameter for the rectangular mask. A larger value results in a higher degree of edge feathering.

    radius

    float

    [0.0, the larger of the material's width or height]

    0.1

    The border radius of the rectangular mask.

    • A value from 0.0 to 1.0 represents a radius size relative to the larger of the material's width or height.

    • A value greater than 1.0 represents an absolute pixel value.

    angle

    float

    [-9999.0, 9999.0]

    0.0

    The rotation angle.

  • Linear

    type = mask_linear

    Parameter

    Type

    Valid values

    Default value

    Description

    x

    float

    [0.0, material width]

    0.5

    The X coordinate of the linear mask's central reference point within the material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    y

    float

    [0.0, material height]

    0.5

    The Y coordinate of the linear mask's central reference point within the video material, relative to the video's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    antialias

    float

    [0.0, 1.0]

    0.1

    The anti-aliasing parameter for the linear mask. A larger value results in a higher degree of edge feathering.

    angle

    float

    [-9999.0, 9999.0]

    0.0

    The rotation angle.

  • Mirror

    type = mask_minor

    Parameter

    Type

    Valid values

    Default value

    Description

    x

    float

    [0.0, material width]

    0.5

    The X coordinate of the mirror mask's central reference point within the material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's width.

    • A value greater than 1.0 represents an absolute pixel value.

    y

    float

    [0.0, material height]

    0.5

    The Y coordinate of the mirror mask's central reference point within the material, relative to the material's top-left corner.

    • A value from 0.0 to 1.0 represents a coordinate relative to the material's height.

    • A value greater than 1.0 represents an absolute pixel value.

    antialias

    float

    [0.0, 1.0]

    0.1

    The anti-aliasing parameter for the mirror mask. A larger value results in a higher degree of edge feathering.

    angle

    float

    [-9999.0, 9999.0]

    0.0

    The rotation angle.

Video freeze frame

Trims the video from 0s to 3s and appends a 2-second freeze frame.

Final effect

Timeline example

{
  "VideoTracks": [{
    "VideoTrackClips": [{
      "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
      "In": 0,
      "Out": 3,
      "Effects": [{
        "Type": "FreezeFrame",
        "Duration": 2
      }]
    }]
  }],
  "SubtitleTracks": [{
    "SubtitleTrackClips": [{
      "Type": "Text",
      "TimelineIn": 0,
      "TimelineOut": 3,
      "X": 0,
      "Y": 150,
      "Font": "HappyZcool-2016",
      "Content": "Trim material 0-3s",
      "Alignment": "TopCenter",
      "FontSize": 80,
      "FontColor": "#F5FFFA",
      "FontFace": {
        "Bold": true
      }
    }, {
      "Type": "Text",
      "TimelineIn": 0,
      "TimelineOut": 3,
      "X": 0,
      "Y": 150,
      "Font": "HappyZcool-2016",
      "Content": "Freeze frame 2s",
      "Alignment": "TopCenter",
      "FontSize": 80,
      "FontColor": "#F5FFFA",
      "FontFace": {
        "Bold": true
      }
    }]
  }]
}

References