This topic describes the composition parameters, advanced configurations, and software development kit (SDK) call examples for the movie highlights scenario.
Automated script-based video generation and smart content matching video generation use the same API to submit tasks. For more information about how to use parameters to distinguish between them, see Parameter differences.
Note: For this API, the region specified in the Object Storage Service (OSS) URL of all media assets must match the region of the OpenAPI endpoint.
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.
To better understand this topic, read User guide for one-click smart video generation to learn about the concepts and procedures for the movie highlights 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
For information about the API used to produce videos in batches from multiple video, audio, and image assets, see SubmitBatchMediaProducingJob - Produce multiple smart videos at a time. For more information about the key API parameters, see the descriptions of the InputConfig, EditingConfig, and OutputConfig parameters later in this topic.
To retrieve detailed information about a batch video generation job, see GetBatchMediaProducingJob - Get information about a batch smart video generation job.
InputConfig parameters
Use InputConfig to specify parameters for basic assets such as 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> | An array of titles. A random title is selected for each video generation. You can specify up to 50 titles. Each title can contain up to 50 characters. | ["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 information. Used for scenario-related parameters. | For more information, see 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 | The matching scenario type. For the movie highlights scenario, set this parameter to the static field "MovieHighlights". | Yes |
|
ShotInfo | Configure the storyboard. | Yes |
| |
FaceInfo | Configure face information. | No | Fully supported |
ShotInfo parameters
This parameter applies only to the storyboard mode. You do not need to set this parameter for the global narration mode.
Parameter | Type | Description | Required |
ShotScripts | List<ShotScript> | An array of shot scripts. | Yes |
ShotScript parameters
This parameter applies only to the storyboard mode. You do not need to set this parameter for the global narration mode.
In the storyboard mode of the movie highlights scenario, two shot modes are available: Text description mode and Manual parsing mode. You must select one of these modes when you set the parameters.
Parameter | Type | Description | Example | Required | Shot mode |
ScriptText | String | The script text for a single shot. It describes the content of the shot. Summarize the shot content 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> | Detailed descriptions for a single shot. Summarize the shot content 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> | The names of the characters (faces) in a single shot. Note: The character names must be the same as the 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> | A list of character (face) photos. The list can contain up to 200 photos. | No |
ImageInfo parameters
Parameter | Type | Description | Example | Required |
Name | String | Character (face) name. | Daniel | Yes |
ImageURL | String | The storage address of the character (face) photo. It must be a URL accessible over the Internet. Ensure that the face image contains only one individual and the face is clear, without significant 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
Use EditingConfig to specify the volume, position, and other composition parameters for the output video assets. If you do not have special requirements, you can use the default configurations and leave this field empty.
The parameter descriptions are the same for the global narration and storyboard modes in the movie highlights scenario.
Parameter | Type | Description | Example | Required |
JSON | Configurations for input video assets. | For more information, see Parameter example. | No | |
JSON | Configurations for the title. You can configure caption parameters. For more information about the fields, see Banner text. | For more information, see Parameter example. | No | |
SubHeadingConfig | JSON | Configurations for multi-level subtitles. You can set caption parameters. JSON field description:
| For more information, see Parameter example. | No |
JSON | Configurations for the narration script. | For more information, see Parameter example. | 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. | For more information, see Parameter example. | No | ||
FECanvas | JSON | Canvas configurations for frontend page previews. | {"Width": 1080,"Height": 1920} | No |
ProduceConfig | JSON | Standard video editing and composition configurations. For more information about the fields, see 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 | Specifies whether to add special effects. | true | No. Default value: false. |
VfxEffectProbability | Float | The probability of applying special effects to each video clip. Value range: 0.0 to 1.0. Up to two decimal places are supported. | 0.6 | No. Default value: 0.5. |
VfxFirstClipEffectList | List<String> |
| ["slightshow","starfieldshinee"] | No |
VfxNotFirstClipEffectList | List<String> |
| ["zoomslight","zoom"] | No |
AllowTransition | Boolean | Specifies whether to add transitions. | true | No. Default value: false. |
TransitionDuration | Float | The transition duration in seconds. If the transition duration is greater than the clip duration minus 1, the transition for that clip does not take effect. | 0.5 | No. Default value: 0.5s. |
TransitionList | List<String> | A list of custom transitions. If AllowTransition is set to true, a random transition from the list is selected for composition. For the available transitions, see Transition library. If this parameter is empty, a random effect is selected from the following: "linearblur", "colordistance", "crosshatch", "dreamyzoom", and "doomscreentransition_up". | ["directional", "linearblur"] | No |
UseUniformTransition | Boolean | Specifies whether to use the same transition throughout a single video. | true | No. Default value: true. |
AllowFilter | Boolean | Specifies whether to add custom filters. | false | No. Default value: false. |
FilterList | List<String> | A list of custom filters. If AllowFilter is set to true, a random filter from the list is selected for composition. For available filters, see Filter effect examples. If this parameter is empty, no filter is added. | ["m1", "m2"] | No |
AllowDuplicateMatch | Boolean | Specifies whether matched clips can be reused. | false | No. Default value: false. |
EnableClipDetection: | Boolean | Specifies 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 | Specifies 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, // Specifies whether to add special effects
"AllowTransition": false, // Specifies whether to add transitions
"AllowDuplicateMatch": false, // In smart content matching mode, specifies whether matched clips can be reused
"EnableClipDetection": true, // Specifies whether to perform shot detection
"EnableTemporalOpt": true // Specifies whether to perform temporal optimization
}
}TemplateConfig parameters
TemplateConfig is a common parameter used to set a template for one-click video generation. For detailed parameter descriptions and examples, see TemplateConfig parameters.
OutputConfig parameters
Use OutputConfig to specify parameters such as the output address, naming rules, width, height, and the 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
You have installed the Intelligent Media Service (IMS) server-side SDK. For more information, see Preparations.
Code example
The following example shows how to use the global narration mode.
Details of API request parameters
Advanced configurations
For more information about advanced configurations, see 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:
What is the difference between global narration mode and storyboard mode?
How do I correctly set face information?