Intelligent production allows you to produce multiple videos after simple configurations. You can produce videos in script-to-video or intelligent image-text matching mode. This topic describes the editing logic and advanced configurations of quick video production.
Advanced configurations
The advanced configurations not only support convenient, quick, and simplified editing but also provide multiple parameters that can be used to adjust the effect of output videos. The following examples show some commonly used configurations.
Configure the background music, voice-over style, and volume
The following sample code provides an example on EditingConfig configurations:
{
"SpeechConfig": {
"Style": "Gentle",
"Gain": 1.1
},
"BackgroundMusicConfig": {
"Style": "bgm-relaxing",
"Gain": 0.2
}
}
For more information about the fields and values, see Configurations of voice-over scripts and Configurations of background music.
Configure the voice-over voice and tempo
Specify the same voice for all output videos. The following sample code provides an example on EditingConfig configurations:
{
"SpeechConfig": {
"Voice": "zhiru"
}
}
To use random voices selected from a list, use the following EditingConfig configurations. Separate multiple voices with commas (,).
{
"SpeechConfig": {
"Voice": "zhiru,zhilun,zhibei_emo"
}
}
Adjust the voice-over tempo. The following sample code provides an example on EditingConfig configurations:
{
"SpeechConfig": {
"SpeechRate": 100
}
}
For more information about the valid values of SpeechRate, see Configure SpeechRate.
Configure subtitle effects
EditingConfig supports one or more subtitle effects, similar to voices.
Example 1: Select a random subtitle entrance animation effect between wave_in and fade_in, and the wave_out subtitle exit animation effect:
{ "SpeechConfig": { "AsrConfig": { "AaiMotionInEffect": "wave_in,fade_in" "AaiMotionInEffect": "wave_out" } } }
Example 2: Select a random subtitle loop effect between normal_display and naughty_display:
{ "SpeechConfig": { "AsrConfig": { "AaiMotionLoopEffect": "normal_display,naughty_display" } } }
Configure the start and end of input materials
If you want to use only some clips from an overlength input material, you can specify the start and end of the clips that you want to use in the EditingConfig configurations.
Example 1: Specify the start and end of materials in text-to-video mode:
InputConfig: { "MediaGroupArray": [ { "GroupName": "group1", "MediaArray": [ "****9d46c886b45481030f6e****", "****c886810b4549d4630f6e****" ] }, { "GroupName": "group2", "MediaArray": [ "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test1.mp4", "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test2.png", "****9d46c886b45481030f6e****", ] } ], "Title": "Freshippo Opens a Store in Huilongguan", "SpeechText": "Freshippo opens a store near the shopping mall. Today is the first day of opening. Come and check it out. The store is not large but the prices of snacks and drinks are low, which attract many customers waiting in lines.", "BackgroundMusic": "****b4549d46c88681030f6e****", } EditingConfig: { "MediaConfig": { "Volume": 0, "MediaMetaDataArray": [ { "Media": "****9d46c886b45481030f6e****", "GroupName": "group1" "TimeRangeList": [ { "In": 5, "Out": 10 }, { "In": 15, "Out": 20 } ] }, { "Media": "****9d46c886b45481030f6e****", "GroupName": "group2", "TimeRangeList": [ { "In": 0, "Out": 5 } ] }, { "Media": "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test1.mp4", "GroupName": "group2", "TimeRangeList": [ { "In": 0, "Out": 20 } ] } ] } }
Example 2: Specify the start and end of materials in intelligent image-text matching mode:
InputConfig: { "MediaArray": [ "****9d46c886b45481030f6e****", "****c886810b4549d4630f6e****", "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test1.mp4", "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test2.png" ], "Title": "Freshippo Opens a Store in Huilongguan", "SpeechText": "Freshippo opens a store near the shopping mall. Today is the first day of opening. Come and check it out. The store is not large but the prices of snacks and drinks are low, which attract many customers waiting in lines.", "BackgroundMusic": "****b4549d46c88681030f6e****", } EditingConfig: { "MediaConfig": { "MediaMetaDataArray": [ { "Media": "****9d46c886b45481030f6e****", "TimeRangeList": [ { "In": 5, "Out": 10 }, { "In": 15, "Out": 20 } ] }, { "Media": "http://test-bucket.oss-cn-shanghai.aliyuncs.com/test1.mp4", "TimeRangeList": [ { "In": 5, "Out": 10 } ] } ] } }
Configure special effects
You can configure EditingConfig parameters to add special effects to video clips. You can also control the frequency of the special effects. The following sample code provides an example on EditingConfig configurations:
{
"ProcessConfig": {
"AllowVfxEffect": true,
"VfxEffectProbability": 1.0 // Add special effects to each clip.
}
}
Configure transitions
You can configure EditingConfig parameters to add transitions to video clips. You can also specify custom transitions. The following sample code provides an example on EditingConfig configurations:
{
"ProcessConfig": {
"AllowTransition": true,
"TransitionList": ["linearblur", "colordistance", "crosshatch", "dreamyzoom", "doomscreentransition_up"]
}
}
By default, the transition may be different for each output video. However, within the same output video, the same transition is used. If you want to use random transitions within an output video, use the following EditingConfig configurations:
{
"ProcessConfig": {
"AllowTransition": true,
"UseUniformTransition": false
}
}
Configure custom backgrounds
By default, if the resolution of the input material is different from the resolution of the output video, the extra area is automatically filled with a system background image or a blurred background. You can configure a custom background image, a blurred background, or a solid color background.
Example 1: Configure a custom background image:
{ "MediaArray": [ "****9d46c886b45481030f6e****" ], "Title": "Freshippo Opens a Store in Huilongguan", "SpeechText": "Freshippo opens a store near the shopping mall. Today is the first day of opening. Come and check it out. The store is not large but the prices of snacks and drinks are low, which attract many customers waiting in lines.", "BackgroundMusic": "****b4549d46c88681030f6e****", "BackgroundImage": "****c88681b4549d46030f6e****" }
Example 2: Configure a blurred background:
{ "BackgroundImageConfig": { "SubType": "Blur", "Radius": 0.1 } }
Example 3: Configure a solid color background:
{ "BackgroundImageConfig": { "SubType": "Color", "Color": "#000000" } }
Configure callbacks for completed quick video production tasks
After you run an intelligent quick video production task, multiple editing tasks are initiated to produce videos. A callback is returned when all subtasks are complete. For more information about the callback fields, see the "BatchProduceMediaComplete" section of the Event list topic.
Configure global callbacks
You can configure a global callback for completed intelligent quick video production tasks in the IMS console or by calling API operations. For more information, see Configure callback events.
Configure operation-specific callbacks
When you configure an intelligent quick video production task, you can specify a callback address in the userData field for the task. For more information, see Configure the parameters for intelligent and quick batch video production.