Composition parameters, advanced configurations, and SDK call examples for the movie highlights scenario.
-
Automated script-based and smart content matching video generation share the same task submission API. To distinguish between them by parameters, see Parameter differences.
-
The region in the OSS URL of all media assets must match the OpenAPI endpoint region.
-
Supported regions: China (Shanghai), China (Beijing), China (Hangzhou), China (Shenzhen), US (West), and Singapore.
-
In the examples, replace placeholders such as [your-bucket], [your-region-id], [your-file-name], [your-file-path], and media asset IDs (for example, "****9d46c8b4548681030f6e****") with your actual values.
-
The User guide for one-click smart video generation covers concepts and procedures for this scenario.
-
The movie highlights scenario supports two video generation modes. This topic describes the following modes in detail:
-
Global narration mode
-
Storyboard mode
-
Usage notes
-
To produce videos in batches from multiple media assets, call SubmitBatchMediaProducingJob - Produce multiple smart videos at a time. Key parameters (InputConfig, EditingConfig, and OutputConfig) are described below.
-
To query a batch job, call GetBatchMediaProducingJob - Get information about a batch smart video generation job.
InputConfig parameters
InputConfig specifies basic asset parameters: video clips, narration, background music, and stickers.
|
Parameter |
Type |
Description |
Example |
Required |
Supported modes |
|
MediaArray |
List<String> |
|
["****b4549d46c88681030f6e****","****549d46c88b4681030f6e****"] |
Yes |
Fully supported |
|
TitleArray |
List<String> |
Array of titles. A random title is selected per video. Maximum: 50 titles, 50 characters each. |
["Title 1","Title 2"] |
No |
Fully supported |
|
SubHeadingArray |
List<SubHeading> |
Subtitle settings. |
[{"Level":1,"TitleArray":["Level-1 Subtitle 1","Level-1 Subtitle 2"]},{"Level":3,"TitleArray":["Level-3 Subtitle"]}] |
No |
All modes |
|
SpeechTextArray |
List<String> |
|
["Narration content 1","Narration content 2"] |
No |
|
|
SceneInfo |
Scenario-related parameters. |
Parameter example: Global narration mode and Parameter example: Storyboard mode. |
Yes |
|
|
|
StickerArray |
List<Sticker> |
|
[{"MediaId":"****9d46c8b4548681030f6e****","X":10,"Y":100,"Width":300,"Height":300,"Opacity":0.6}] |
No |
All modes |
|
BackgroundMusicArray |
List<String> |
|
["****b4549d46c88681030f6e****","****549d46c88b4681030f6e****"] |
No |
Fully supported |
|
BackgroundImageArray |
List<String> |
|
["****b4549d46c88681030f6e****","****549d46c88b4681030f6e****"] |
No |
All modes |
SceneInfo parameters
|
Parameter |
Type |
Description |
Required |
Supported modes |
|
Scene |
String |
Matching scenario type. Set to the static field "MovieHighlights" for this scenario. |
Yes |
|
|
ShotInfo |
Configure the storyboard. |
Yes |
|
|
|
FaceInfo |
Configure face information. |
No |
Fully supported |
ShotInfo parameters
Applies only to storyboard mode.
|
Parameter |
Type |
Description |
Required |
|
ShotScripts |
List<ShotScript> |
An array of shot scripts. |
Yes |
ShotScript parameters
-
Applies only to storyboard mode.
-
Two shot modes are available: Text description mode and Manual parsing mode. Select one when setting parameters.
|
Parameter |
Type |
Description |
Example |
Required |
Shot mode |
|
ScriptText |
String |
Script text describing the shot content. Summarize in one or two sentences. |
In the subway car, Lin Xia sits in a corner, quietly recording with her phone. An old woman is holding her grandson's hand, humming a song softly. |
No |
Text description mode |
|
SpeechText |
String |
|
The late-night car is quiet, but some people light up the whole car with their songs. |
No |
All modes |
|
Duration |
Float |
|
5 |
No |
|
|
Descriptions |
List<String> |
Shot descriptions. Summarize in one or two sentences. |
["Lin Xia sits in a corner of the subway car, quietly recording with her phone", "An old woman holds her grandson's hand, humming a song softly"] |
No |
Manual parsing mode |
|
Characters |
List<String> |
Character (face) names for a single shot. Must match ImageInfo.Name in FaceInfo.ImageInfoList. |
["Lin Xia", "Old woman", "Grandson"] |
No |
|
|
Settings |
List<String> |
The scene description for a single shot. |
["Late-night subway car"] |
No |
|
|
Volume |
Float |
|
0.5 |
No |
Fully supported |
FaceInfo parameters
|
Parameter |
Type |
Description |
Required |
|
ImageInfoList |
List<ImageInfo> |
List of character (face) photos. Maximum: 200. |
No |
ImageInfo parameters
|
Parameter |
Type |
Description |
Example |
Required |
|
Name |
String |
Character (face) name. |
Daniel |
Yes |
|
ImageURL |
String |
URL of the character (face) photo. Must be publicly accessible. The image must contain only one face, clearly visible without obstructions or missing parts. |
http://[your-cdn-domain]/[your-file-path]/face1.png |
Yes. You must specify one of the two parameters. |
|
ImageId |
String |
Image media asset ID. |
****9d46c886b45481030f6e**** |
Parameter example: Global narration mode
{
"MediaArray": [
"****9d46c886b45481030f6e****",
"****c886810b4549d4630f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test1.mp4",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test2.png"
],
"SceneInfo": {
"Scene": "MovieHighlights", // MovieHighlights for movie highlights matching
"FaceInfo": {
"ImageInfoList": [
{
"Name": "Character A",
"ImageURL": "https://bkimg.cdn.bcebos.com/pic/3853ad1bdd9f70558718bf38?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080"
},
{
"Name": "Character B",
"ImageURL": "https://bkimg.cdn.bcebos.com/pic/622762d0f703918ffbedc1125b3d269759eec42e?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080"
},
{
"Name": "Character C",
"ImageId": "****b681034549d46c880f6e****"
}
]
}
},
"TitleArray": [
"Hema Fresh in Huilongguan is now open!",
"Hema Fresh is now open!"
],
"SubHeadingArray": [
{
"Level": 1,
"TitleArray": ["Subtitle 1", "Subtitle 2"]
},
{
"Level": 3,
"TitleArray": ["Level-3 Subtitle"]
}
],
"SpeechTextArray": [
"A new Hema Fresh just opened in the nearby mall. It's the grand opening today, so I rushed over to join the fun. This Hema isn't very big, but the mall is packed. Snacks and drinks are quite cheap, and the lines are incredibly long. Come and check it out!",
"A new Hema Fresh just opened in the nearby mall. It's the grand opening today, so I rushed over to join the fun."
],
"Sticker": {
"MediaId": "****b681034549d46c880f6e****",
"X": 10,
"Y": 100,
"Width": 300,
"Height": 300
},
"StickerArray": [
{
"MediaId": "****9d46c8b4548681030f6e****",
"X": 10,
"Y": 100,
"Width": 300,
"Height": 300,
"Opacity": 0.6
},
{
"MediaURL": "http://[your-bucket].oss-[your-region-id].aliyuncs.com/test3.png",
"X": 10,
"Y": 100,
"Width": 300,
"Height": 300
}
],
"BackgroundMusicArray": [
"****b4549d46c88681030f6e****",
"****549d46c88b4681030f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test4.mp3"
],
"BackgroundImageArray": [
"****6c886b4549d481030f6e****",
"****9d46c8548b4681030f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test1.png"
]
}
Parameter example: Storyboard mode
{
"MediaArray": [
"****9d46c886b45481030f6e****",
"****c886810b4549d4630f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test1.mp4",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test2.png"
],
"SceneInfo": {
"Scene": "MovieHighlights", // MovieHighlights for movie highlights matching
"ShotInfo": {
"ShotScripts": [
// Start of text description mode example. For each shot, choose either manual parsing mode or text description mode.
{
"ScriptText": "In the subway car, Lin Xia sits in a corner, quietly recording with her phone. An old woman is holding her grandson's hand, humming a song softly.",
"SpeechText": "The late-night car is quiet, but some people light up the whole car with their songs."
},
{
"ScriptText": "The old woman's white hair glows under the car lights. She strokes her grandson's head and whispers, 'Do you remember this song?'",
"SpeechText": "Her world may be blurry, but in front of him, she is still the most gentle mother."
},
{
"ScriptText": "Lin Xia stops filming and looks at the billboards flashing by outside the window, her expression softening.",
"SpeechText": "I thought I was recording someone else's story, but I was quietly healed."
},
{
"ScriptText": "At home, Lin Xia takes out her camera and writes her first diary entry: 'Today, I saw what happiness looks like.'",
"SpeechText": "Sometimes, happiness isn't about big things, but the small moments we overlook."
},
{
"ScriptText": "A few days later, a series of heartwarming photos on Lin Xia's social media resonates with netizens.",
"SpeechText": "She starts telling stories with her lens, and every story holds a piece of love."
},
{
"ScriptText": "At night, Lin Xia enters the subway station again, this time with a smile and a new goal.",
"SpeechText": "This city is big, but there's always someone waiting for you, and someone worth discovering."
}
// End of text description mode example
// Start of manual parsing mode example. For each shot, choose either manual parsing mode or text description mode.
{
"Descriptions": ["Lin Xia sits in a corner of the subway car, quietly recording with her phone", "An old woman holds her grandson's hand, humming a song softly"],
"Characters": ["Lin Xia", "Old woman", "Grandson"],
"Settings": ["Late-night subway car"],
"SpeechText": "The late-night car is quiet, but some people light up the whole car with their songs."
},
{
"Descriptions": ["The old woman's white hair glows under the car lights", "She strokes her grandson's head and speaks softly"],
"Characters": ["Old woman", "Grandson"],
"Settings": ["Subway car"],
"SpeechText": "Her world may be blurry, but in front of him, she is still the most gentle mother."
},
{
"Descriptions": ["Lin Xia stops filming", "Looks at the billboards flashing by outside the window, her expression softening"],
"Characters": ["Lin Xia"],
"Settings": ["Moving subway car"],
"SpeechText": "I thought I was recording someone else's story, but I was quietly healed."
},
{
"Descriptions": ["Lin Xia takes out her camera at home", "Writes her first diary entry: 'Today, I saw what happiness looks like'"],
"Characters": ["Lin Xia"],
"Settings": ["Modern apartment / Room"],
"SpeechText": "Sometimes, happiness isn't about big things, but the small moments we overlook."
},
{
"Descriptions": ["Heartwarming photos are posted on Lin Xia's social media page", "Netizens like and comment one after another"],
"Characters": ["Lin Xia"],
"Settings": ["Phone screen / Social media interface"],
"SpeechText": "She starts telling stories with her lens, and every story holds a piece of love."
},
{
"Descriptions": ["At night, Lin Xia enters the subway station", "She has a smile and a new goal"],
"Characters": ["Lin Xia"],
"Settings": ["City subway station"],
"SpeechText": "This city is big, but there's always someone waiting for you, and someone worth discovering."
}
// End of manual parsing mode example
// You can choose not to configure narration. Configure only the shot script and duration to play the original video sound.
{
"ScripText": "In the subway car, Lin Xia sits in a corner, quietly recording with her phone. An old woman is holding her grandson's hand, humming a song softly.",
"Duration": 8.0, // Can be set when there is no narration script
"Volume": 1.0 // Set the volume of the original video asset
}
]
},
"FaceInfo": {
"ImageInfoList": [
{
"Name": "Character A",
"ImageURL": "https://bkimg.cdn.bcebos.com/pic/3853ad1bdd9f70558718bf38?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080"
},
{
"Name": "Character B",
"ImageURL": "https://bkimg.cdn.bcebos.com/pic/622762d0f703918ffbedc1125b3d269759eec42e?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080"
},
{
"Name": "Character C",
"ImageId": "****b681034549d46c880f6e****"
}
]
}
},
"TitleArray": [
"Hema Fresh in Huilongguan is now open!",
"Hema Fresh is now open!"
],
"StickerArray": [
{
"MediaId": "****9d46c8b4548681030f6e****",
"X": 10,
"Y": 100,
"Width": 300,
"Height": 300
},
{
"MediaURL": "http://[your-bucket].oss-[your-region-id].aliyuncs.com/test3.png",
"X": 10,
"Y": 100,
"Width": 300,
"Height": 300,
"Opacity": 0.6
}
],
"BackgroundMusicArray": [
"****b4549d46c88681030f6e****",
"****549d46c88b4681030f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test4.mp3"
],
"BackgroundImageArray": [
"****6c886b4549d481030f6e****",
"****9d46c8548b4681030f6e****",
"http://[your-bucket].oss-[your-region-id].aliyuncs.com/test1.png"
]
}
EditingConfig parameters
-
EditingConfig specifies volume, position, and other composition parameters for output video assets. Leave empty to use defaults.
-
Parameters apply to both global narration and storyboard modes.
|
Parameter |
Type |
Description |
Example |
Required |
|
JSON |
Configurations for input video assets. |
No |
||
|
JSON |
Title configurations. Caption parameters are described in Banner text. |
No |
||
|
SubHeadingConfig |
JSON |
Configurations for multi-level subtitles. You can set caption parameters. JSON field description:
|
No |
|
|
JSON |
Configurations for the narration script. |
No |
||
|
JSON |
Configurations for background music. |
{"Volume":0.2} |
No |
|
|
JSON |
Configurations for the background image. |
{"SubType":"Blur","Radius":0.5} |
No |
|
|
Remix processing configurations. |
No |
|||
|
JSON |
Canvas configurations for frontend page previews. |
{"Width": 1080,"Height": 1920} |
No |
|
|
ProduceConfig |
JSON |
Standard video editing and composition configurations. Field details: EditingProduceConfig. |
{"AutoRegisterInputVodMedia":true,"OutputWebmTransparentChannel":true,"CoverConfig":{"StartTime":3.3},"AudioChannelCopy":"left","PipelineId":"***d54a97cff4108b555b01166d4b***","MaxBitrate":5000,"KeepOriginMaxBitrate":false,"KeepOriginVideoMaxFps":false} |
No |
ProcessConfig parameters
|
Parameter |
Type |
Description |
Example |
Required |
|
AllowVfxEffect |
Boolean |
Whether to add special effects. |
true |
No. Default value: false. |
|
VfxEffectProbability |
Float |
Probability of applying special effects per clip. Range: 0.0 to 1.0. Up to two decimal places. |
0.6 |
No. Default value: 0.5. |
|
VfxFirstClipEffectList |
List<String> |
|
["slightshow","starfieldshinee"] |
No |
|
VfxNotFirstClipEffectList |
List<String> |
|
["zoomslight","zoom"] |
No |
|
AllowTransition |
Boolean |
Whether to add transitions. |
true |
No. Default value: false. |
|
TransitionDuration |
Float |
Transition duration in seconds. If greater than clip duration minus 1, the transition is skipped for that clip. |
0.5 |
No. Default value: 0.5s. |
|
TransitionList |
List<String> |
Custom transition list. When AllowTransition is true, a random transition from this list is used. Available transitions: Transition library. If empty, defaults to: "linearblur", "colordistance", "crosshatch", "dreamyzoom", and "doomscreentransition_up". |
["directional", "linearblur"] |
No |
|
UseUniformTransition |
Boolean |
Whether to use the same transition throughout a single video. |
true |
No. Default value: true. |
|
AllowFilter |
Boolean |
Whether to add custom filters. |
false |
No. Default value: false. |
|
FilterList |
List<String> |
Custom filter list. When AllowFilter is true, a random filter from this list is used. Available filters: Filter effect examples. If empty, no filter is added. |
["m1", "m2"] |
No |
|
AllowDuplicateMatch |
Boolean |
Whether matched clips can be reused. |
false |
No. Default value: false. |
|
EnableClipDetection: |
Boolean |
Whether to perform shot detection on the source material. This can only be configured for the movie highlights scenario. It supports automatic shot division and identifies shot types. Opening/closing credits, advertisements, and black screens are not included in the final video. |
true |
No. Default value: true. |
|
EnableTemporalOpt |
Boolean |
Whether to perform temporal optimization on the matching results. This can only be configured for the movie highlights scenario. We recommend setting this to true when the input shot information or narration script is mostly consistent with the content order of the source video. |
true |
No. Default value: false. |
|
EnableSubtitleMatch |
Boolean |
Optimizes the match between the narration script and the video frames based on Optical Character Recognition (OCR) and Automatic Speech Recognition (ASR) results.
|
true |
No. Default value: false. |
EditingConfig parameter example
All parameters in EditingConfig are optional. The following code shows the default configurations.
{
"MediaConfig": {
"Volume": 0 // Mute the source video by default
},
"TitleConfig": {
"Alignment": "TopCenter",
"AdaptMode": "AutoWrap",
"Font": "Alibaba PuHuiTi 2.0 95 ExtraBold",
"SizeRequestType": "Nominal",
"Y": 0.1, // Y-coordinate of the title for a vertical video
"Y": 0.05, // Y-coordinate of the title for a horizontal video
"Y": 0.08 // Y-coordinate of the title for a square video
},
"SpeechConfig": {
"Volume": 1, // Use the original volume for the narration audio by default
"SpeechRate": 0,
"Voice": null,
"Style": null,
"CustomizedVoice": null, // Voice clone voiceId. If this field is specified, Voice and Style become invalid.
"AsrConfig": {
"Alignment": "TopCenter",
"AdaptMode": "AutoWrap",
"Font": "Alibaba PuHuiTi 2.0 65 Medium",
"SizeRequestType": "Nominal",
"Spacing": -1,
"Y": 0.8, // Y-coordinate of the captions for a vertical video
"Y": 0.9, // Y-coordinate of the captions for a horizontal video
"Y": 0.85 // Y-coordinate of the captions for a square video
}
},
"SubHeadingConfig": {
"1": {
"Y": 0.3,
"FontSize": 40
},
"3": {
"Y": 0.5,
"FontSize": 30
}
},
"BackgroundMusicConfig": {
"Volume": 0.2, // Use 20% volume for the background music by default
"Style": null
},
"ProcessConfig": {
"AllowVfxEffect": false, // Whether to add special effects
"AllowTransition": false, // Whether to add transitions
"AllowDuplicateMatch": false, // In smart content matching mode, specifies whether matched clips can be reused
"EnableClipDetection": true, // Whether to perform shot detection
"EnableTemporalOpt": true // Whether to perform temporal optimization
}
}
TemplateConfig parameters
TemplateConfig sets a template for one-click video generation. Parameters and examples: TemplateConfig parameters.
OutputConfig parameters
OutputConfig specifies the output address, naming rules, dimensions, and number of videos to produce.
|
Parameter |
Type |
Description |
Example |
Required |
|
MediaURL |
String |
The output video address. It must contain the {index} placeholder. |
Rule: http://[your-bucket].oss-[your-region-id].aliyuncs.com/[your-file-path]/[your-file-name]_{index}.mp4 Example: http://example.oss-[your-region-id].aliyuncs.com/example/example_{index}.mp4 |
Required when GeneratePreviewOnly is false and the output video is sent to OSS. |
|
StorageLocation |
String |
The storage address for the media asset file to be output to VOD. |
Rule: [your-vod-bucket].oss-[your-region-id].aliyuncs.com Example: outin-****6c886b4549d481030f6e****.oss-[your-region-id].aliyuncs.com |
Required when GeneratePreviewOnly is false and the output video is sent to VOD. |
|
FileName |
String |
The output file name. It must contain the {index} placeholder. |
Rule: [your-file-name]__{index}.mp4 Example: example_{index}.mp4 |
Required when GeneratePreviewOnly is false and the output video is sent to VOD. |
|
GeneratePreviewOnly |
Boolean |
|
false |
No. Default value: false. |
|
Count |
Integer |
The number of output videos.
|
1 |
No. Default value: 1. |
|
Width |
Integer |
The width of the output video in pixels. |
1080 |
Yes |
|
Height |
Integer |
The height of the output video in pixels. |
1920 |
Yes |
|
JSONObject |
Configurations for the output video stream, such as Crf and Codec. |
{"Crf": 27} |
No |
Parameter example
{
"MediaURL": "http://[your-bucket].oss-[your-region-id].aliyuncs.com/[your-file-path]/[your-file-name]_{index}.mp4",
"Count": 1,
"Width": 1080,
"Height": 1920,
"Video": {"Crf": 27},
"GeneratePreviewOnly":false
}
SDK call example
Prerequisites
IMS server-side SDK installed. Preparations.
Code example
The following example shows how to use the global narration mode.
Details of API request parameters
Advanced configurations
Advanced configurations: Remix logic and advanced configurations for batch one-click video generation.
FAQ
For answers to frequently asked questions about automated script-based video generation, see Movie highlights FAQ: