Capabilities and preparation
Use mixed-cut analyze / generate to understand the materials and creative goals, intelligently arrange visuals and narrative rhythm, and generate the video after plan confirmation. Depends on meitu-kaipai-cli, verified target version 0.1.8, compatible with >=0.1.8 <0.2.0。
For first execution, readPlatform onboarding, check the version and mixed-cut analyze --help、mixed-cut generate --help. When JSON fields or media limits are unclear, query the platform instructions for kaipai contracts the entries for the current analysis/generation commands; when modifying the voice-over plan, readGenerate answer. When encountering output parsing, inquiries, or exceptions, readRunning and recovery。
- Supports images, videos, and mixed materials; multiple images can be directly created into a finished video; specific media formats are validated by the CLI. The server automatically selects the appropriate analysis branch based on the materials.
- Material branch
material_mixed_cutuses the actual material arrangement, script, and voice-over information; the voice-over branchtalking_mixed_cutuses ARoll video as the main axis, with optional BRoll images/videos, retaining the original voice-over. The ARoll video constraint applies only to the voice-over branch. - Optional
--target-durationspecifies a target duration of 5–180 seconds, and the server plans the rhythm based on the materials; omit if unspecified.--languageprovides content language context; the voice-over branch retains the original voice-over;--langsets the client language. - Fully write creative requirements such as pause optimization, rhythm, aspect ratio, and duration into the analysis Prompt, and proceed based on the plan returned by the server and user confirmation.
a_roll_textis used read-only as the recognized original voice-over text, and delivery is based on the actually returned finished video.
Collect materials and analyze
- Extract 1–10 real image/video files or URLs and the theme from the current request, and carry forward the complete copy, material order, story mainline, and rhythm requirements already provided by the user. When materials and theme are complete, directly prepare the materials and analyze, without requiring prior division into ARoll/BRoll; only ask follow-up questions for missing information that affects the result.
- For local materials, use real readable files; for remote materials, first followPlatform onboardingto download the original resources item by item, including existing session and historical artifact URLs. Preserve the original source, local path, cross-type order, and duplicates; if download fails, ask the user to download it themselves and provide the local file, and analyze only after all selected materials are complete. If there are more than 10, first assist with selection, without truncating, arbitrarily generating in batches, or automatically choosing for the user.
- Arrange in user order
--image-file / --video-file, and parameters of the same type may also repeat; do not regroup by type. When reusing the original session, add-r '<session_id>', and omit for new tasks. Merge the theme and known requirements into-p, and pass optional parameters according to the current help. - After the CLI validates the entire batch, upload in order, obtain the owned CDN URL, and submit for analysis once, without first
create-room / add-media, and without using--item-id. Describe roles such as "the first material", do not treat local paths as remote references, and do not fabricate visuals or edit points that have not yet been identified.
Below shows mixed image and video input; add or remove file parameters according to the actual materials and keep the order, and it also applies to pure images or pure videos:
kaipai mixed-cut analyze --image-file '<本地图片路径>' --video-file '<本地视频路径>' -p '<用户主题与要求>'
Analysis only creates a plan and does not start final video generation; save the returned real session, Task ID, and source material mapping. Handle default values, login, and secure parameter passing according to the platform instructions; use parameter files and standalone prechecks for complex inputs only as needed.
Wait for and confirm the plan
- Read from real Message Parts or Task
status.messagePartsdata.type=mixed_cut_brief, according to(session_id, brief_id)update; do not guess IDs from plain text, numbering, or examples. pendingonly query history read-only or known Tasks; even if history exits due to idle, generation must not occur. Query serially at moderate intervals; if there is no update for a long time, explain the status and retain recovery information, and do not loop re-analysis.failedstop; if the Brief is missing, first recover history, and if it is still missing, report the issue. Command exit, Run completion, and Session idle do not mean the Brief is ready.readyaccording to the realbrief_typedisplay the plan: for voiceover, show the main video, supplementary materials, target duration, and read-onlya_roll_text; for the material branch, show the actual material arrangement,script / voice_idand target duration. Do not guess fields that were not returned, and do not claim to have seen footage that was not obtained.- It is a normal process for images to return a material branch; when the type is unknown or information required by the service is missing, handle it as an actual inquiry, do not force a type change, and do not fabricate fields.
- After displaying the ready plan, obtain the user's explicit confirmation. A previous vague "help me edit" or "one-click video" cannot replace confirmation of a plan that has not yet been displayed; when the user modifies the plan, first explain the final changes and do not repeatedly confirm the same plan that has already been explicitly accepted.
Generation and modification
Generate through the resolved CLI entry point using the real session and ready Brief confirmed by the user. Both branches use the same command; the material branch omits --answer, and no ARoll needs to be provided.
kaipai mixed-cut generate -r '<session_id>' --brief-id '<brief_id>'
Submit after login is valid and the current ready Brief has been confirmed by the user. Precheck only as needed when checking or troubleshooting parameters; precheck cannot prove that the Brief exists, is ready, that materials belong to it, or that the user has confirmed it. The CLI submits generation directly and does not precheck history; the caller must verify the current Brief based on the actual analysis results.
- Only the voiceover branch can adjust
--answerviaa_roll_media / b_roll_media / target_duration. Media items contain only realshort_id / kind; ARoll must have at least one item and all must be videos, while BRoll may be an empty array to indicate clearing. Omit unmodified fields; direct flags serialize the complete answer into one parameter, and for complex answers theanswerobject in a parameter file can be used; see the generation answer reference for details. - The answer may only select materials already analyzed in the current plan; do not pass
type / a_roll_text / script / voice_id / confirmed_fields, URLs, or local paths. For complete constraints, see the generation answer reference; the answer is submitted together with the generation action. - When adding or replacing source materials, or modifying the material branch topic, copy, material selection, or duration, first download the remote original resource according to the platform instructions, re-analyze the complete local materials and update requirements in the original session, and generate after displaying and confirming the new Brief; do not register new materials first.
reply --approveonly handles approval under the current permissions,reply --answeronly replies to actual native inquiries, and neither can replace Brief generation or the above plan modifications.
Follow-up and delivery
- Continuously read the original command's stdout and stderr separately, save all tasks, and avoid opening another observer at the same time.
TASK_STATE_COMPLETEDand only deliver after obtaining a usable video URL for this run; HTTP 200, exit code 0,end.reason=resultand unknown statuses cannot by themselves prove success. - Deliver each genuinely usable video promptly, save the complete URL and
viva.short_id, and if there is an actualroom_urlAttach the session entry point. Only hand it over todynamic-captionwhen the user needs subtitles; if the corresponding Skill is not installed, inform them that an equivalent subtitle process is required, and do not add processing on your own. - When the URL is missing or expired, query the Task/history first; do not substitute the media ID or cover image for the video. When the connection drops, times out, or acceptance is unknown, only perform read-only recovery; do not automatically re-analyze or regenerate. Retry only after the failure cause has been fixed and the user has authorized it.
- If subtitle generation or download fails, do not redo the successful mixed cut; retain and deliver the successful part. After processing ends and no recovery is needed, clean up the temporary materials or parameter files from this session, and keep the user's original files; for specific recovery and saving details, see the operating instructions.