This topic describes how to configure the Timeline parameters in the SubmitMediaProducingJob operation to edit 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 Intelligent production overview.
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 Preparations.
Configure the video width and height
When you call the SubmitMediaProducingJob operation to submit a video editing task, you can use the Width and Height fields in the OutputMediaConfig parameter to define the resolution of the output video.
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);
Rotate a video from the landscape mode to the portrait mode and add black bars
If the video in the timeline is in the landscape mode, and you set the output video to portrait mode when you submit the editing task, the system scales the video to fit the new dimensions and centers it within the frame.
Effect | Timeline example |
|
Rotate a video from the landscape mode to the portrait mode and blur the blank area
Value range of Radius: [0.01, 1]. For more information, see Effect Type:Background.
Effect | Timeline example |
|
Convert a landscape video into a 3-split screen video in portrait mode
The AdaptMode=Cover parameter indicates that the material is resized according to the original aspect ratio to fill in the view. For information about other parameters, see VideoTrackClip.
Effect | Timeline example |
|
Rotate a video from the landscape mode to the portrait mode and set the background color
Effect | Timeline example |
|
Extract a video clip
By configuring In=3 and Out=8, you can extract a clip that spans from the third second to the eighth second from the video.
Effect | Timeline example |
|
Extract and merge multiple video clips
You can leave the TimelineIn and TimelineOut fields empty. By default, the system merges the clips by using their default start and end time.
If MaxOut is set to 5, a maximum of 5 seconds are extracted from the clip.
If the duration of the clip exceeds 5 seconds, only the first 5 seconds are extracted.
If the duration of the clip is less than 5 seconds, the entire clip up to its end is extracted.
Effect | Timeline example |
|
Edit images and videos
The default value of Type is Video. If you want to edit images, set Type to Image.
Effect | Timeline example |
|
Add a watermark, sticker, or GIF sticker
To edit images in GIF format, you must configure the DyncFrames parameter, which specifies the frame rate of GIF materials.
Effect | Timeline example |
|
Configure scaling
The valid values of AdaptMode are Contain, Cover, and Fill. For more information, see VideoTrackClip.
Effect | Timeline example |
|
Configure picture-in-picture
In VideoTracks, the order of tracks in the array matters, with the last track being rendered on top of the previous tracks.
Effect | Timeline example |
|
Configure a horizontal or vertical flip
Effect | Timeline example |
|
Crop a video
Effect | Timeline example |
|
Configure speed ramping
In AudioTrackClips, you can use the Speed parameter to configure audio and video speed ramping.
Effect | Timeline example |
|
Rotate a material
Effect | Timeline example |
|