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 |
|
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 |
|
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 |
|
Convert a landscape video to portrait and set the background color
|
Final effect |
Timeline example |
|
Trim a video
`In=3` and `Out=8` trim the segment from 3s to 8s.
|
Final effect |
Timeline example |
|
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 |
|
Mix videos and images
The default value of `Type` is `Video`. To use an image material, set `Type` to `Image`.
|
Final effect |
Timeline example |
|
Add watermarks, stickers, or GIF stickers
For GIF images, set `DyncFrames` to the number of frames in the GIF.
|
Final effect |
Timeline example |
|
Scale modes
`AdaptMode` accepts `Contain`, `Cover`, and `Fill`. VideoTrackClip.
|
Final effect |
Timeline example |
|
Picture-in-picture
In `VideoTracks`, later tracks have a higher layer level and overlay earlier tracks.
|
Final effect |
Timeline example |
|
Horizontal and vertical flips
|
Final effect |
Timeline example |
|
Crop a video
|
Final effect |
Timeline example |
|
Change audio and video speed
`AudioTrackClips` also supports the `Speed` parameter for playback speed control.
|
Final effect |
Timeline example |
|
Rotate a material
|
Final effect |
Timeline example |
|
Circle, rectangle, linear, and mirror masks
|
Final effect |
Timeline example |
|
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 |
|