All Products
Search
Document Center

Intelligent Media Services:Transitions, visual effects, and filters

Last Updated:Dec 09, 2024

This topic describes how to modify the Timeline parameters in the SubmitMediaProducingJob operation to configure transitions, visual effects, and filters.

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.

Transitions

Add transitions

  • Add a wiperight transition between the first and second clips. The transition duration is 1 second by default.

  • Add a perlin transition between the second and third clips, and set the transition duration to 2 seconds by specifying Duration.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media",
            "Effects": [{
                "Type": "Transition",
                "SubType": "wiperight"
            }]
        }, {
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media",
            "Effects": [{
                "Type": "Transition",
                "SubType": "perlin",
                "Duration": 2
            }]
        }, {
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4"
        }]
    }]
}

Add random transitions

  • Set SubType to random to add a random transition between the first and second clips. This indicates that a transition is selected and applied at random from all available transitions.

  • Set SubType to wiperight,perlin to add a random transition between the second and third clips. This indicates one of wiperight and perlin is used as the transition at random.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Effects": [{
                "Type": "Transition",
                "SubType": "random"
            }]
        }, {
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Effects": [{
                "Type": "Transition",
                "SubType": "wiperight,perlin"
            }]
        }, {
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4"
        }]
    }]
}

Visual effects

Add visual effects to a single clip

Add a horizontal blur effect to the first clip. In this case, the configuration field of the visual effect must be included in the Effect array of the corresponding clip. If you do not specify the start time and end time, the visual effect lasts for the same duration as that of the corresponding clip by default.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "VFX",
                "SubType": "h_blur"
            }]
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }]
}

Add visual effects to the entire video

Add a horizontal blur effect to the entire video. In this case, the configuration field of the visual effect must be included in an independent EffectTracks array and is not associated with any clip. If you do not specify the start time and end time, the visual effect lasts for the same duration as that of the video by default.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "VFX",
            "SubType": "h_blur"
        }]
    }]
}

Add visual effects to part of the video

Set TimelineIn to 3 and TimelineOut to 7 to add a horizontal blur effect to the part between the 3rd and 7th seconds of the video.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "VFX",
            "SubType": "h_blur",
            "TimelineIn": 3,
            "TimelineOut": 7
        }]
    }]
}

Add random visual effects

  • Set SubType to random to add a random visual effect to the first clip. This indicates that a visual effect is selected and applied at random from all available effects.

  • Set SubType to movie,image_in_image to add a random visual effect to the second clip. This indicates one of movie and image_in_image is used as the visual effect at random.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "VFX",
                "SubType": "random"
            }]
        }, {
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "VFX",
                "SubType": "movie,image_in_image"
            }]
        }]
    }]
}

Filters

Add filters to a single clip

Add a gray-orange filter to the first clip. In this case, the filter configuration field must be included in the Effect array of the corresponding clip. If you do not specify the start time and end time, the filter lasts for the same duration as that of the corresponding clip by default.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "Filter",
                "SubType": "m7"
            }]
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }]
}

Add filters to the entire video

Add a gray-orange filter to the entire video. In this case, the filter configuration field must be included in an independent EffectTracks array and is not associated with any clip. If you do not specify the start time and end time, the filter lasts for the same duration as that of the video by default.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "Filter",
            "SubType": "m7"
        }]
    }]
}

Add filters to part of the video

Set TimelineIn to 3 and TimelineOut to 7 to add a gray-orange filter to the part between the 3rd and 7th seconds of the video.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "Filter",
            "SubType": "m7",
            "TimelineIn": 3,
            "TimelineOut": 7
        }]
    }]
}

Video color grading

You can set SubType under Filter to color to edit video colors.

In the following example, the configurations are applied to the third to seventh seconds of the video:

  1. Set brightness to -10 to decrease the brightness.

  2. Set contrast to 10 to increase the contrast.

  3. Set saturation to 10 to increase the saturation.

  4. Set dark_corner_ratio to 50 to increase the vignette effect.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5
        },{
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "Filter",
            "SubType": "color",
            "TimelineIn": 3,
            "TimelineOut": 7,
            "ExtParams": "effect=color,brightness=-10,contrast=10,saturation=10,kelvin_temperature=6000,temperature_ratio=0,tint=0,dark_corner_ratio=50"
        }]
    }]
}

Add random filters

Set SubType to random to add a random filter to the first clip. This indicates that a filter is selected and applied at random from all available filters.

Set SubType to pj2,pj3 to add a random filter to the second clip. This indicates one of pj2 and pj3 is used as the filter at random.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "Filter",
                "SubType": "random"
            }]
        }, {
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 5,
            "Effects": [{
                "Type": "Filter",
                "SubType": "pj2,pj3"
            }]
        }]
    }]
}

Ken Burns

You can apply the Ken Burns effect when converting images to videos or creating photo albums.

The following example configurations add a Ken Burns effect to pan from the original image in the lower left corner to the upper right corner.

Effect

Illustration

Timeline example

image

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "Type": "Image",
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.png",
            "Duration": 5,
            "Effects": [{
                "Type": "KenBurns",
                "Start": "0,0.5,0.5,0.5",
                "End": "0.5,0,0.5,0.5"
            }]
        }]
    }]
}

Default effect

If you do not configure the KenBurns parameters, the animation behaves in the following ways:

  1. If the input and output are both in landscape or portrait mode, the effect is a slow zoom out.

  2. If the input is in landscape mode and the output is in portrait mode, the effect is a slow slide to the right.

  3. If the input is in portrait mode and the output is in landscape mode, the effect is a slow slide downward.

Default effect 1: A slow zoom-out if the input and output are both in landscape or portrait mode

Effect

Illustration

Timeline example

image

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "Type": "Image",
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.png",
            "Duration": 5,
            "Effects": [{
                "Type": "KenBurns"
            }]
        }]
    }]
}

Default effect 2: A slow slide to the right if the input is in landscape mode and the output is in portrait mode

Effect

Illustration

Timeline example

OutputMediaConfig example

image

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "Type": "Image",
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h1.png",
            "Duration": 5,
            "Effects": [{
                "Type": "KenBurns"
            }]
        }]
    }]
}

Set the output to portrait mode by setting Width to 1080 and Height to 1920.

{
    "MediaURL": "Specify the OSS URL of the media asset"
    "Width": 1080,
    "Height": 1920
}

Default effect 3: A slow slide downward if the input is in portrait mode and the output is in landscape mode

Effect

Illustration

Timeline example

OutputMediaConfig example

image

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "Type": "Image",
            "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/v1.jpg",
            "Duration": 5,
            "Effects": [{
                "Type": "KenBurns"
            }]
        }]
    }]
}

Set the output to landscape mode by setting Width to 1920 and Height to 1080.

{
    "MediaURL": "Specify the OSS URL of the media asset"
    "Width": 1920,
    "Height": 1080
}

Configure transitions, visual effects, and filters altogether

The following example shows the configurations of combining filters, visual effects, and transitions.

  1. Add a random transition between the first and second clips.

  2. Add a perlin transition between the second and third clips.

  3. Add a visual effect named withcircleflashlight to the first clip.

  4. Add a filter named pl3 to the second clip.

  5. Add a filter named warm to the part between the 11th and 13th seconds of the video.

Effect

Timeline example

{
    "VideoTracks": [{
        "VideoTrackClips": [{
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h1.mp4",
            "Out": 6,
            "Effects": [{
                "Type": "Transition",
                "SubType": "random",
                "Duration": 1
            }, {
                "Type": "VFX",
                "SubType": "withcircleflashlight"
            }]
        }, {
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h2.mp4",
            "Out": 6,
            "Effects": [{
                "Type": "Transition",
                "SubType": "perlin",
                "Duration": 1
            }, {
                "Type": "Filter",
                "SubType": "pl3"
            }]
        }, {
            "MediaURL": "http://ice-public-media.oss-cn-shanghai.aliyuncs.com/test_media/h3.mp4",
            "Out": 5
        }]
    }],
    "EffectTracks": [{
        "EffectTrackItems": [{
            "Type": "Filter",
            "SubType": "warm",
            "TimelineIn": 11,
            "TimelineOut": 13
        }]
    }]
}

References